My question is if the moving average condition "crosses", but the other
conditions have NOT been met (yet), how long will the first condition stay
"True" to allow the additional conditions time to happen and trigger the trade ?
If the second or third condition takes 5 more minutes, I still want the
trade to execute. I am wondering is there a maximum length of time the "Cross Over" and "Cross Under" conditions are valid? (I would prefer not to use the ">" and "<" conditions, as the resutls are much less).
The CrossAbove() and CrossBelow() methods have a signature such as:
CrossAbove(series1, series2, lookBackPeriod)
Where "lookBackPeriod" sets the number of bars where the cross must have occured within for the method to return a true value.
Therefore, if you want to check if the Cross of two MA's occured within the last three bars, you would write:
if (CrossAbove(SMA(10), SMA(20), 3))
// Do something
Comment