SymbolIsSynchronized

La funzione controlla se i dati di un simbolo selezionato nel terminale sono sincronizzati con i dati sul server di trade.

bool  SymbolIsSynchronized(
   string  name,       // nome simbolo
   );

Parametri

name

[in] Nome del Simbolo.

Return value

Se i dati sono sincronizzati, restituisce 'true', in caso contrario restituisce 'false'.

Esempio

#define SYMBOL_NAME "EURUSD"
 
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- ottenere il flag per la sincronizzazione dei dati nel terminale utilizzando il simbolo 'SYMBOL_NAME' con i dati del server
   bool   sync = SymbolIsSynchronized(SYMBOL_NAME);
   
//--- creare un messaggio a seconda del flag di sincronizzazione
   string text = StringFormat("The data on the '%s' symbol in the terminal is synchronized with the data on the trading server."SYMBOL_NAME);
   if(!sync)
      text = StringFormat("The data for the '%s' symbol in the terminal is not synchronized with the data on the trading server."SYMBOL_NAME);
   
//--- inviare il risultato ottenuto al journal
   Print(text);
   
  /*
  risultato per i dati sincronizzati:
   The data on the 'EURUSDsymbol in the terminal is synchronized with the data on the trading server.
   
  risultato per i dati non ancora sincronizzati:
   The data for the 'GBPHKDsymbol in the terminal is not synchronized with the data on the trading server.
  */
  }

Vedi anche

SymbolInfoInteger, Organizzazione Accesso Dati