Tell the EA to close orders if in profit for a certain time
YThi MJ: If so, how could I code it?
Each tick, see if in profit.
- If no, set a static/global datetime to zero.
- If yes and the datetime is zero, set it to current time.
- If yes, compare current time to the datetime and if greater than X, close all orders.
No free help 2017.04.21
Hi, I am looking at my trades and, although the EA is doing quite well I have seen that it might be a good idea to exit some trades after some time. Due not having reached TP, it might get stuck in flat movements, so I would like to know if I can tell the EA:
If in Profit for X time, close all orders.
If so, how could I code it?