MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
Write an Article and Earn Money

How can I add capability to my EA to close all the open positions and DO NOTHING in specific circumstances

Back to topics list To post a new topic, please log in or register
avatar
65
CyrusTheGreat 2011.02.16 15:24
 

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?

 
Trading News Events: Canada Consumer Price Index (CPI) - To Hold Above 2% Target for Eighth Consecutive Month
A slowdown in Canada’s Consumer Price Index (CPI) may spur fresh monthly highs in USD/CAD especially as the Bank of Canada (BoC) remains reluctant to further normalize monetary policy. What’s Expected: Why Is This Event Important: However, another uptick in the core rate of inflation may heighten the appeal of the loonie as sticky price growth undermines the BoC’s scope to retain the current policy, and Governor Stephen Poloz may sound increasingly hawkish in 2015 as the central bank head highlights the broadening recovery in the Canadian economy.
avatar
Moderator
3854
ubzen 2011.02.16 16:17 #
 
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.
 
Back to topics list  

To add comments, please log in or register