Forums ProRealTime English forum ProOrder support first hit of a moving average Reply To: first hit of a moving average

#75412

I modified the above code to the below – difference is the trade should get taken on first hit of the 50MA (rather than the 20MA). But there is another condition and that is when prices do hit the 50MA, the next bar’s high must be greater than the 50MA to take the trade. I can’t quite get it to work though based on the results I have attached. The entry gets taken even when the next bar’s high isn’t greater than the 50MA (in dark blue). Yellow = 200 and light blue = 20. Any idea’s what I am doing wrong? I have brushed up on my coding since last time and can now actually read what’s going on sort of 🙂 … Sorry I tried to entry the code into the correct window, but this is what I got below.