function to check condition on watch list symbols

 
I want to write a function that examines a condition on all the watch list symbols. Does anyone have a code in this regard?
 
Mohammad Reza Zahedi:
I want to write a function that examines a condition on all the watch list symbols. Does anyone have a code in this regard?
   string Sym = "";
   for(int i=0;i<SymbolsTotal(true);i++)
   {
      Sym = SymbolName(i,true);
      // Check condition
   }

This?

 
Mohammad Reza Zahedi: I want to write a function that examines a condition on all the watch list symbols. Does anyone have a code in this regard?
  1. Perhaps you should read the manual.
              Market Info - Reference on algorithmic/automated trading language for MetaTrader 5

  2. On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors before accessing prices.
              Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum

    On MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.
              Timeseries and Indicators Access /  Data Access - Reference on algorithmic/automated trading language for MetaTrader 5
              Synchronize Server Data with Terminal Data - Symbols - General - MQL5 programming forum

Reason: