Price to stay above 100-bar moving average for 20 bars for EA

 

Hi,


How do I code this? I want to have a system that will sell when price crossed below its 100-bar moving average and the price must stay above its 100-bar moving average for more than or equal to 20 bars


Thanks in advance.

 
kentaicm: How do I code this?
For the last 20 bars compare Low vs MA. Show us your code and state the problem.
Reason: