Thanks, I think I got the price gain thing right. However, I have a little other problem.
I want the alert to trigger only when the relative volume line exceeds a value of 10000. However, today's test triggered various alerts that were much less than this value.
Attached is my code.