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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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?