Create multi-currency EA

 

i'd like to make my EA iterate through symbols , but for some reason the code isn't working 

void OnTick()
  {
  
     
    for(int i=0;i<SymbolsTotal(true);i++) {
    
    string sym = SymbolName(i,true);

    MqlRates pricedata [];
    ArraySetAsSeries(pricedata,true);
    int data =CopyRates(sym,Period(),0,550,pricedata);
    
    double ask = NormalizeDouble(SymbolInfoDouble(sym,SYMBOL_ASK),_Digits);
    double bid = NormalizeDouble(SymbolInfoDouble(sym,SYMBOL_BID),_Digits);
   

    then my logic 

 }
}
 
andrw11:

i'd like to make my EA iterate through symbols , but for some reason the code isn't working 

You are not doing it right check here  https://www.mql5.com/en/docs/constants/tradingconstants/enum_trade_request_actions

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types
  • www.mql5.com
Trading is done by sending orders to open positions using the OrderSend() function, as well as to place, modify or delete pending orders. Each trade order refers to the type of the requested operation. Trading operations are described in the ENUM_TRADE_REQUEST_ACTIONS enumeration...
Reason: