Jack Buda:
Hi all
I want to run my EA on all pairs but to open on one pair only. So for an example, EA is currently running on EUR/USD,GBP/USD,XAU/USD etc. The EA decides to open a trade/s on EUR/USD, my EA will open trade/s on other pairs. Please help on how I can prevent this from happening.
You could create a global variable which holds the preferred currency pair - when you open your 1st trade, set the global variable
After that if the EA wants to open a trade, make sure it checks the global variable and only does so if _Symbol matches
- Jack Buda: I want to run my EA on all pairs but to open on one pair only.
Stop counting how many orders on the current symbol if(CheckOpenOrders()) if(TimeCurrent()>=NextTradeBuy) if(CountSymbol(Symbol())==0)
And just look at how many total orders are open //if(CheckOpenOrders()) if(TimeCurrent()>=NextTradeBuy) //if(CountSymbol(Symbol())==0) if(OrdersTotal()==0)
- R4tna C #: You could create a global variable which holds the preferred currency pair - when you open your 1st trade, set the global variableTotally unnecessary.
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 all
I want to run my EA on all pairs but to open on one pair only. So for an example, EA is currently running on EUR/USD,GBP/USD,XAU/USD etc. The EA decides to open a trade/s on EUR/USD, my EA will open trade/s on other pairs. Please help on how I can prevent this from happening.