CalendarValueById

 

I am getting timed out with no result when calling the function CalendarValueById(). Previous to this I call CalendarEventByCurrency(), which returns an array of events. But when I am trying to get the values for any event the debugger hangs and when it eventually responds there is an empty Value returned. My simple test code looks like below. I have also tried different alternatives offered by the documentation for other functions returning Values. I always get a list of Events but never any Values.

Thx,
Timid

void getCalendarEvents() 
{
        bool ret;
        MqlCalendarEvent calendarEvent;
        MqlCalendarValue calendarValue;
 
//--- get EU currency events       
        int count = CalendarEventByCurrency("EUR",events); 
        
        if(count>10) 
        { 
                ArrayRemove(events,0,ArraySize(events)-10); 
        } 
        
//--- display events in the Journal     
        ArrayPrint(events);
        
        for (int i=0; i<10; i++)
        {
                calendarEvent = events[i];
                ret = CalendarValueById(calendarEvent.id, calendarValue);
                Print(calendarValue.impact_type);
        }
}
Reason: