How to get the maximum price after the price crosses the ma21.
-
HI.
I am trying to get the max price, so in the block condition the highest price (candles period) the parameter "end candle" was the cross of the price above the ma 21.
thanks.
-
Here the question is how to calculate at which candle that cross happened. Here is some idea: https://fxdreema.com/shared/eHWR6SX5d
But what do you mean by "price crosses the ma21" - it matters. Because in the history of prices you have 4 prices for each candle and these values.
The idea in this example is that I have one variable that I set with value 0 before the calculation, then I check whether the Condition is true for candle 0, and if it's not, I increment its value and run Condition with the updated value... as a result Condition runs one or more times, until it passes. After that the value of the variable will have some value - the number of times that Condition passed minus 1, which is the same as the last CandleID used in Condition.