CalendarEventByCurrency
Obtém um array de descrições de todos os eventos disponíveis no Calendário para a moeda especificada.
int CalendarEventByCurrency(
const string currency,
MqlCalendarEvent& events[]
);
|
Parâmetros
currency
[in] Código da moeda do país
events[]
[out] Array do tipo MqlCalendarEvent para obter descrições de todos os eventos da moeda especificada.
Valor retornado
- 4001 ERR_INTERNAL_ERROR (erro geral de tempo de execução),
- 4004 ERR_NOT_ENOUGH_MEMORY (memória insuficiente para execução da solicitação),
- 5401 ERR_CALENDAR_TIMEOUT (excedido tempo limite de solicitação),
- falha ao executar ArrayResize()
Exemplo:
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//--- declare um array para receber eventos do Calendário Econômico
MqlCalendarEvent events[];
//--- obtenha eventos para a moeda da União Europeia
int count = CalendarEventByCurrency("EUR",events);
Print("count = ", count);
//--- por exemplo, 10 eventos são suficientes para nós
if(count>10)
ArrayResize(events,10);
//--- imprima eventos no Diário
ArrayPrint(events);
}
/*
Resultado:
[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"
*/
|
Veja também
CalendarEventById, CalendarEventByCountry