#define SYMBOL_NAME "GBPHKD"
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 서버 심볼 검색 결과의 플래그를 설정합니다.
bool found = false;
//--- 모든 서버 심볼 목록에서 'SYMBOL_NAME' 심볼을 찾습니다.
int total = SymbolsTotal(false);
for(int i=0; i<total; i++)
{
//--- 루프 인덱스로 목록에서 심볼명을 가져옵니다.
string name = SymbolName(i, false);
//--- 이것이 원하는 심볼이라면 목록의 이름과 위치를 저널에 보내고 루프를 종료합니다.
if(name == SYMBOL_NAME)
{
PrintFormat("The '%s' symbol was found in the list of server symbols at index %d", name, i);
found = true;
break;
}
}
//--- 서버에서 심볼을 찾을 수 없으면 종료하기 전에 이를 보고합니다.
if(!found)
PrintFormat("The '%s' symbol was not found on the server.", SYMBOL_NAME);
}
|