4ex:
hi everyone
I have a question for you, I would like to create a EA that will open max 1 order on every currency, but that can open many position on different currency. ex: never more than 1 position on eur-usd, but the EA could open 1 position on eur-usd, 1 on gbp usd, 1 on usdchf....
or if it's easier: to take only 1 position at the time on a graph but can take more position with other graph?
do you know the programmation to do that?
thank you very much
I have a question for you, I would like to create a EA that will open max 1 order on every currency, but that can open many position on different currency. ex: never more than 1 position on eur-usd, but the EA could open 1 position on eur-usd, 1 on gbp usd, 1 on usdchf....
or if it's easier: to take only 1 position at the time on a graph but can take more position with other graph?
do you know the programmation to do that?
thank you very much
int open=OrdersTotal();
for(int qw=0;qw<open;qw++)
{
OrderSelect(qw,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol())
{return(0);}
}
put that code above your OrderSend function.
It will escape the EA if an order is already opened for the current chart, so if you have this EA on the EURUSD chart, it will scan to see if an order is already placed for EURUSD, and will escape if the position is opened. If EURUSD position is not opened, it will proceed to the OrderSend function to place your order.
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
I have a question for you, I would like to create a EA that will open max 1 order on every currency, but that can open many position on different currency. ex: never more than 1 position on eur-usd, but the EA could open 1 position on eur-usd, 1 on gbp usd, 1 on usdchf....
or if it's easier: to take only 1 position at the time on a graph but can take more position with other graph?
do you know the programmation to do that?
thank you very much