CalendarEventByCurrency

指定された通貨でカレンダーで利用可能なすべてのイベントの説明の配列を取得します。

int  CalendarEventByCurrency(
  const string         currency,    // 国の通貨のコード名
  MqlCalendarEvent&    events[]     // 説明配列を受け取るための変数
  );

パラメータ

currency

[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"        
*/  

参照

CalendarEventByIdCalendarEventByCountry