CalendarEventByCountry

캘린더에서 사용할 수 있는 모든 이벤트에 대한 설명 배열을 지정된 국가 코드로 가져오기

int  CalendarEventByCountry(
   string               country_code,     // 국가 코드명 (ISO 3166-1 alpha-2)
   MqlCalendarEvent&    events[]          // 설명 배열 수신을 위한 변수
   );

매개변수

country_code

[in]  국가 코드명 (ISO 3166-1 alpha-2)

events[]

[out]  지정된 국가에 대한 모든 이벤트에 대한 설명 수신을 위한MqlCalendarEvent 유형 배열.

값 반환

수신된 설명 수. 오류에 대한 정보를 얻기 위해GetLastError() 함수 호출. 가능한 오류:

  • 4001 – ERR_INTERNAL_ERROR  (일반 실행시간 오류),
  • 4004 – ERR_NOT_ENOUGH_MEMORY (요청된 작업을 위한 메모리가 충분하지 않음),
  • 5401 – ERR_CALENDAR_TIMEOUT (요청시간 제한 초과),
  • 다음에 대한 실행 실패 오류: ArrayResize()

예를 들어:

//+------------------------------------------------------------------+
//| 스크립트 프로그램 시작 함수                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- EU의 국가 코드 (ISO 3166-1 Alpha-2)
   string EU_code="EU";
//--- EU 이벤트 가져오기
   MqlCalendarEvent events[];
   int events_count=CalendarEventByCountry(EU_code,events);
//--- 저널에 EU 이벤트 표시
   if(events_count>0)
     {
      PrintFormat("EU events: %d",events_count);
      ArrayPrint(events);
     }
//---
  }
/*
  결과:
  EU 이벤트: 56
             [id] [type]  [country_id] [unit] [importance] [multiplier] [digits] [event_code]                                     
   [ 0] 999010001      0          999      0            2            0        0  "ECB Non-monetary Policy Meeting"   
   [ 1] 999010002      0          999      0            2            0        0  "ECB Monetary Policy Meeting Account
   [ 2] 999010003      0          999      0            3            0        0  "ECB Monetary Policy Press Conferenc
   [ 3] 999010004      0          999      0            3            0        0  "ECB President Draghi Speech"       
   [ 4] 999010005      0          999      0            2            0        0  "ECB Vice President Constancio Speec
   [ 5] 999010006      1          999      1            3            0        2  "ECB Deposit Facility Rate Decision"
   [ 6] 999010007      1          999      1            3            0        2  "ECB Interest Rate Decision"        
   [ 7] 999010008      0          999      0            2            0        0  "ECB Economic Bulletin"             
   [ 8] 999010009      1          999      2            2            3        3  "ECB Targeted LTRO"                 
   [ 9] 999010010      0          999      0            2            0        0  "ECB Executive Board Member Praet Sp
   [10] 999010011      0          999      0            2            0        0  "ECB Executive Board Member Mersch S   
   ...
 
*/

추가 참조

CalendarCountries, CalendarCountryById