#define SYMBOL_NAME "GBPUSDn"
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 사용자 정의 심볼 플래그를 선언하고 SYMBOL_NAME에 지정된 이름을 가진 심볼이 있는지 확인합니다.
bool custom = false;
bool result = SymbolExist(SYMBOL_NAME, custom);
//--- 디폴트로 '심볼를 찾을 수 없음' 메시지 텍스트 선언
string text = StringFormat("The symbol '%s' was not found among either the standard or custom symbols.", SYMBOL_NAME);
//--- 심볼이 발견되면 심볼이 발견된 목록에 따라 메시지 텍스트를 생성합니다.
if(result)
{
//--- 만약 이것이 스탠다드 심볼이라면
if(!custom)
text = StringFormat("The '%s' symbol is available on the server.", SYMBOL_NAME);
//--- 만약 이것이 별도로 만든 심볼이라면
else
text = StringFormat("The symbol '%s' was found in the list of custom symbols.", SYMBOL_NAME);
}
//--- 확인 결과와 관련한 메시지를 저널로 보냅니다.
Print(text);
/*
result for standard 'GBPUSD' symbol:
The 'GBPUSD' symbol is available on the server.
result for custom 'GBPUSDx' symbol:
The symbol 'GBPUSDx' was found in the list of custom symbols.
result for missing 'GBPUSDn' symbol:
The symbol 'GBPUSDn' was not found among either the standard or custom symbols.
*/
}
|