Distance less than certain amount of time
-
I am playing around with the "check the distance between two levels" block to try to do the following: if the distance between point A (candle close[0]) and point B (MA20/50 crossover which is stored in a variable) is less than 10 candles, then execute orange output. For "... this value" I'm using Value -> Time -> Candle Time but it's not working. Any ideas?
-
Distance less than 10 candles, what is that means? This blocks check the vertical distance, prices, how 10 candles fit in this picture?
-
I want to say "if the distance in time (horizontal distance, not veritical) between point and and point b is less than 10 candles"
-
Well, this block does A-B and compares this to C. The time is in it's own format - seconds from 1.1.1970 - and you can for example compare Candle Time [0] (or the current server time, notice that Candle Time does not change in every second) with another Candle Time that you have it in a variable. Again, this is measured in seconds, so foe example 1 hour is 3600 seconds.
If this function can also help: http://docs.mql4.com/en/common/periodseconds