SymbolIsSynchronized

Vérifie que les données du symbole indiqué sont synchronisées avec les données du serveur de trading

bool  SymbolIsSynchronized(
   string  name,       // nom du symbole
   );

Paramètres

name

[in]  Le nom du symbole.

Valeur de retour

Retourne true si les données sont correctement synchronisées, false sinon.

Exemple :

#define SYMBOL_NAME "EURUSD"
 
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- récupère le flag de synchronisation des données dans le terminal pour le symbole 'SYMBOL_NAME' avec le serveur de données
   bool   sync = SymbolIsSynchronized(SYMBOL_NAME);
   
//--- crée un message suivant la valeur de flag de synchronisation
   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);
   
//--- envoie les données obtenues dans le journal
   Print(text);
   
   /*
   result for synchronized data:
   The data on the 'EURUSDsymbol in the terminal is synchronized with the data on the trading server.
   
   result for data not yet synchronized:
   The data for the 'GBPHKDsymbol in the terminal is not synchronized with the data on the trading server.
   */
  }

Voir aussi

SymbolInfoInteger, Organiser l'Accès aux Données