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.
R