How can I add capability to my EA to close all the open positions and DO NOTHING in specific circumstances
Stop using stop & reverse logic. You can tell it to Buy when X=true/1 and Sell when X=false/-1. Personally, I like to use integers instead of Bool for my Trigger. You can also do things like set the Trigger to 0 when closing orders.

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
All of EA's that I have worked with open ie. long position and when condition changes close the open position and goes for short position right a way. There is always another condition that EA should close all the open positions and simply do NOTHING. Can you guide me how can I add this capability to my codes?