Counting candles
-
Is there a simple way of counting the number of candles between two of them, and saving that result to a variable?
I know how to create and modify variables, just unsure the best way of counting candles.
Thanks
-
Between two of them... which two? If you know their ID's, just get the difference. If you know their times... the same, with little more calculations.
-
Thanks for the reply. How do I get the times or IDs of specific candles? For example, let's say I have a block that waits until a certain condition gets met. And then the same process happens again for another condition. I'd like to count the candles between those two conditions if that makes sense.
-
If you do the whole process forward, I mean you detect condition 1 and then Condition 2, then meanwhile you can just increment some Variable while the EA is working. Counting candles is for the case when you somehow detect the previous candle NOW. If this is the case and you somehow know the ID, there is no reason to search for the time of the candle, because you already know its ID. If the ID is 15, then there are 14 candles between candle 0 and candle 15. But with the EA it's kinda tricky to find the ID of a past condition, because the Condition block works in the current time and does not search for past conditions.