Check age based on candles
-
Hi All
Is it possible to check the age of a trade based on candles rather than time? From what I can see the check age block does not have this option. -
The easiest way is to define a variable that increases by 1 when a new candle opens if there is a trade running.
int BarCounter = 0
Once per bar - If trade -> BarCounter = BarCounter+1
You have to reset that variable when there is no trade. My suggestion is to reset it when a new trade opens.
This is just an example

