string OrderSymbolArray[]; //Globally Declared //+------------------------------------------------------------------+ int CountOrderSymbols() { int as=0; ArrayResize(OrderSymbolArray,0); for(int x=OrdersTotal()-1;x>=0;x--) { bool found=false; if(OrderSelect(x,SELECT_BY_POS) && (OrderType()==OP_BUY || OrderType()==OP_SELL)) //Check excluding Pending Orders //if(OrderSelect(x,SELECT_BY_POS)) //Check Active & Pending Orders { for(int y=as-1;y>=0;y--) { if(OrderSymbol()==SymbolArray[y]) { found=true; break; } } if(!found) { as++; ArrayResize(OrderSymbolArray,as); OrderSymbolArray[as-1]=OrderSymbol(); } } } return(as); }
This will count the symbols and also put the symbol names in an array.
It's old code of mine, but I thinjk that it should work ok

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
Hello,
I am looking for a script that would return the number of active symbol on the account (number of symbols that have active orders). Il would use this value in an EA to limit the number of active symbols.
Thank you!