CalendarEventByCurrency

캘린더에서 사용할 수 있는 모든 이벤트에 대한 설명 배열을 지정된 통화로 가져옵니다.

int  CalendarEventByCurrency(
   const string         currency,     // 국가 통화 코드명 
   MqlCalendarEvent&    events[]      // 설명 배열을 받기 위한 변수
   );

매개변수

통화

[in]  국가 통화 코드명.

events[]

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

값 반환

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

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

 

예를 들어:

//+------------------------------------------------------------------+
//| 스크립트 프로그램 시작 함수                                          |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- 이코노믹 캘린더 이벤트를 받을 준비를 선언
      MqlCalendarEvent events[];
//--- EU 통화 이벤트 가져오기      
      int count = CalendarEventByCurrency("EUR",events);
      Print("count = ", count);
//--- 현재 예제를 위한 10개의 이벤트로 충분합니다
      if(count>10)
         ArrayResize(events,10);
//--- 저널에 이벤트 표시        
      ArrayPrint(events);
  }
/*
  결과:
             [id] [type] [country_id] [unit] [importance]                                        [source_url]                                 [event_code]                                    [name] 
   [0] 999010001      0          999      0            2 "https://www.ecb.europa.eu/home/html/index.en.html" "ecb-non-monetary-policy-meeting"            "ECB Non-monetary Policy Meeting"                
   [1] 999010002      0          999      0            2 "https://www.ecb.europa.eu/home/html/index.en.html" "ecb-monetary-policy-meeting-accounts"       "ECB Monetary Policy Meeting Accounts"           
   [2] 999010003      0          999      0            3 "https://www.ecb.europa.eu/home/html/index.en.html" "ecb-monetary-policy-press-conference"       "ECB Monetary Policy Press Conference"           
   [3] 999010004      0          999      0            3 "https://www.ecb.europa.eu/home/html/index.en.html" "ecb-president-draghi-speech"                "ECB President Draghi Speech"                    
   [4] 999010005      0          999      0            2 "https://www.ecb.europa.eu/home/html/index.en.html" "ecb-vice-president-vitor-constancio-speech" "ECB Vice President Constancio Speech"           
   [5] 999010006      1          999      1            3 "https://www.ecb.europa.eu/home/html/index.en.html" "ecb-deposit-rate-decision"                  "ECB Deposit Facility Rate Decision"             
   [6] 999010007      1          999      1            3 "https://www.ecb.europa.eu/home/html/index.en.html" "ecb-interest-rate-decision"                 "ECB Interest Rate Decision"                     
   [7] 999010008      0          999      0            2 "https://www.ecb.europa.eu/home/html/index.en.html" "ecb-economic-bulletin"                      "ECB Economic Bulletin"                          
   [8] 999010009      1          999      2            2 "https://www.ecb.europa.eu/home/html/index.en.html" "targeted-ltro"                              "ECB Targeted LTRO"                              
   [9] 999010010      0          999      0            2 "https://www.ecb.europa.eu/home/html/index.en.html" "ecb-executive-board-member-praet-speech"    "ECB Executive Board Member Praet Speech"        
*/  

추가 참조

CalendarEventById, CalendarEventByCountry