//+------------------------------------------------------------------+ //| SymbolInfo.mq4 | //| BlueRain | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "BlueRain" #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ #include void OnStart() { //CArrayString Object variable //sysmbols hold ArrayString CArrayString symbols; //here, it checks all open orders and check if there is already existing sysmbol //if not, it add to ArrayString int orders = OrdersTotal(); for (int i=0; i < orders; i++) { if(OrderSelect(i,SELECT_BY_POS)==false) continue; if (symbols.SearchLinear(OrderSymbol()) < 0) symbols.Add(OrderSymbol()); } // At this time, this symbols object should have list of symbols which has orders. //https://www.mql5.com/en/docs/standardlibrary/datastructures/carraystring // //Methods inherited from class CArray //Step, Step, Total, Available, Max, IsSorted, SortMode, Clear, Sort //Sort //this has sample //https://www.mql5.com/en/docs/standardlibrary/datastructures/carray/carraysort //Sort(0) -> Sorting an array is always ascending. symbols.Sort(0); Print("Total Number of Symbols " + IntegerToString(symbols.Total()) ); for (int i=0; i