OrdersTotal() is for All symbols. If you want a particular symbol the ask if(OrderSymbol()=="EURUSD") <=== After the OrderSelect().
int count=0; for(int iPos = OrdersTotal()-1; iPos >= 0; iPos--) if( OrderSelect(iPos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == Magic.Number // my magic number && OrderSymbol() == chart.symbol // and my pair. ){ count++; } if (count == 0) at EA
Thank you ;)
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
When I write:
OrdersTotal()==0 at EA
this mean that no orders are open for this symbol or for All symbols?
and if it is for all symbols how can i specify it for the symbol which I run the EA on it??