CalendarEventByCountry 4006 Unsuccessful Attempt

 

Code:

MqlCalendarEvent events[];
Print(CalendarEventByCountry("", events));
ArrayPrint(events);

Print(GetLastError());


Log:

RI      0       11:39:03.378    sand (EURUSD.sml,H1)    Executed
RE      0       11:39:53.725    sand (EURUSD.sml,H1)    -1
JQ      0       11:39:53.725    sand (EURUSD.sml,H1)    4006
CH      0       11:41:20.883    sand (EURUSD.sml,H1)    Executed
DD      0       11:42:11.240    sand (EURUSD.sml,H1)    -1
HO      0       11:42:11.240    sand (EURUSD.sml,H1)    4006
OK      0       11:46:00.822    sand (EURUSD.sml,H1)    Executed
GS      0       11:46:51.225    sand (EURUSD.sml,H1)    -1
GL      0       11:46:51.225    sand (EURUSD.sml,H1)    4006
PJ      0       11:48:18.080    sand (EURUSD.sml,H1)    Executed
GR      0       11:49:08.105    sand (EURUSD.sml,H1)    -1
CM      0       11:49:08.105    sand (EURUSD.sml,H1)    4006


Why is it an unsuccessful call? It was working fine before.

 
Randell Tsen Siong Khen:

Code:


Log:


Why is it an unsuccessful call? It was working fine before.


My bad, this should be the correct code.

MqlCalendarEvent events[];
Print(CalendarEventByCountry("", events));
Print(GetLastError());


It returns 5401, so how should I fix it, and would it be a good idea to keep retrying to retrieve for error 5401, and if so how many attempts is a reasonable one?