//+------------------------------------------------------------------+
//| 스크립트 프로그램 시작 함수 |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 클라이언트 터미널에 열린 첫 번째 차트의 ID를 가져옵니다.
long chart_id= ChartFirst();
//--- 획득한 ID를 사용하여 차트 심볼 및 기간을 추가로 가져옵니다.
string symbol = ChartSymbol(chart_id);
ENUM_TIMEFRAMES period = ChartPeriod(chart_id);
//--- 클라이언트 터미널의 첫 번째 차트 설명을 저널에 표시합니다.
PrintFormat("ID of the first chart of the client terminal: %I64d, chart symbol: %s, chart period: %s", chart_id, symbol, StringSubstr(EnumToString(period), 7));
/*
결과:
ID of the first chart of the client terminal: 133246248352168440, chart symbol: EURUSD, chart period: M1
*/
}
|