CalendarEventByCurrency
Ottieni l'array delle descrizioni di tutti gli eventi disponibili nel Calendario in base ad una valuta specificata.
int CalendarEventByCountry(
const string currency,
MqlCalendarEvent& events[]
);
|
Parametri
currency
[in] Nome del codice valuta del Paese.
events[]
[out] MqlCalendarEvent: tipo di array per la ricezione delle descrizioni di tutti gli eventi per una valuta specificata.
Valore di ritorno
- 4001 – ERR_INTERNAL_ERROR (errore di runtime generale),
- 4004 – ERR_NOT_ENOUGH_MEMORY (memoria insufficiente per l'esecuzione di una richiesta),
- 5401 – ERR_CALENDAR_TIMEOUT (tempo limite della richiesta ecceduto),
- errori di esecuzione fallita di ArrayResize()
Esempio:
//+------------------------------------------------------------------+
//| Funzione Start del programma Script |
//+------------------------------------------------------------------+
void OnStart()
{
//--- dichiara l'array per ricevere gli eventi del Calendario Economico
MqlCalendarEvent events[];
//--- ottieni eventi valutari UE
int count = CalendarEventByCurrency("EUR",events);
Print("count = ", count);
//--- 10 eventi sono sufficienti per l'esempio corrente
if(count>10)
ArrayResize(events,10);
//--- visualizza gli eventi nel diario
ArrayPrint(events);
}
/*
Risultato:
[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"
*/
|
Guarda anche
CalendarEventById, CalendarEventByCountry