SymbolIsSynchronized

この関数は、端末で選択されたシンボルのデータがレードサーバ—上のデータと同期化されているかどうかをチェックします。

bool  SymbolIsSynchronized(
  string  name,      // 銘柄名
  );

パラメータ

name

[in]  銘柄名

戻り値

データが同期化されている場合は true、それ以外の場合は false

例:

#define SYMBOL_NAME "EURUSD"
 
//+------------------------------------------------------------------+
//| スクリプトプログラム開始関数                                              |
//+------------------------------------------------------------------+
void OnStart()
 {
//--- SYMBOL_NAMEシンボルを使用して、ターミナル内のデータをサーバーデータと同期するためのフラグを取得する
  bool   sync = SymbolIsSynchronized(SYMBOL_NAME);
 
//--- 同期フラグに応じてメッセージを作成する
  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);
 
//--- 取得した結果を操作ログに送信する
  Print(text);
 
  /*
  同期データの結果:
  The data on the 'EURUSD' symbol in the terminal is synchronized with the data on the trading server.
 
  非同期データの結果:
  The data for the 'GBPHKD' symbol in the terminal is not synchronized with the data on the trading server.
  */
 }

参照

SymbolInfoIntegerデータアクセスの整理