Count number of bars using trade open details NOT variables
-
We have found that when MT4 crashes and we have to reload iour EA that variables get reset.
How do we determine the number of bars / candles that have elapsed from trade open candle to now without using variables? -
@tulefi Hello,
There is a way that may work that requires the use of variables but will not reset upon a crash.
Let the EA draw a vertical line through the current candle as soon as a trade opens, and after that, by constantly modifying a variable with the candle ID of this line, you will always know how many candles ahead you are. -
Hi
Could you show a example of how to modify a variable with candle ID of a line?
Best regards
Tommy -
@tommy78 If you use a pink for each block then in modify variable block with in loop and candle ID you should always have the trade open candle ID even if EA has been switched off and on.