Measure the distance in PIP.
-
Hello friends, one question:
How could you measure the distance in PIP of the last two arrows of the Zigzag Arrow indicator (this indicator repaints)?
0_1596802746577_ZigZag Arrow.mq4 -
@juan-manuel-quiñonero It is not a trivial question. Firstly you need to store both values on two different variables and then use a 'Formula' block to subtract the lower price from the higuer one. However, the difficult part is getting those values from the Zigzag indicator. That can be a real headache!

-
@l-andorrà how would one start trying to get those values back in time?
-
Saving the data in a variable in candle 1 is not a problem, the complicated thing is when many candles have already passed.
-

When we install the EA on the chart and we have the two arrows, it calculates the distance between them. -
@juan-manuel-quiñonero You're right. Finding all previous arrows is a challenge in itself. You should need to create a loop looking for them and even so that would be limited to a specific period of time.
-
It would not be to find all the arrows, only the last two or the last.
-
@juan-manuel-quiñonero Working with zigzag indicator is not easy. Here you have this helpful thread linking to other threads related to it. I suggest you to take your time to read them all caferully.