Cannot Get Calendar News (17 Sep 2021 Release Has bugs, Pls Fix MQL5 Dev)
if(CalendarValueHistory(values,date_from,date_to,country_code)) { // PrintFormat("Received event values for country_code=%s: %d", US_code,ArraySize(values)); //--- decrease the size of the array for outputting to the Journal ArrayResize(values,10); //--- display event values in the Journal // ArrayPrint(values); for(int i=0; i<=9; i++) { MqlCalendarEvent event; if(CalendarEventById(values[i].event_id,event) && event.importance == CALENDAR_IMPORTANCE_HIGH) { Print("====="); hasNews = true; newsCheck = values[i].time + (60*60); // after one hour of news MqlCalendarCountry country; CalendarCountryById(event.country_id,country); PrintFormat("Event description with event_id=%d received",values[i].event_id); PrintFormat("Country: %s (country code = %d)",country.name,event.country_id); PrintFormat("Event name: %s",event.name); PrintFormat("Event code: %s",event.event_code); PrintFormat("Event importance: %s",EnumToString((ENUM_CALENDAR_EVENT_IMPORTANCE)event.importance)); Print("Date: " + values[i].time); Print("Event In: " + double(double(values[i].time - TimeCurrent()) / 3600) + " hour/s"); PrintFormat("Event type: %s",EnumToString((ENUM_CALENDAR_EVENT_TYPE)event.type)); PrintFormat("Event sector: %s",EnumToString((ENUM_CALENDAR_EVENT_SECTOR)event.sector)); PrintFormat("Event frequency: %s",EnumToString((ENUM_CALENDAR_EVENT_FREQUENCY)event.frequency)); PrintFormat("Event release mode: %s",EnumToString((ENUM_CALENDAR_EVENT_TIMEMODE)event.time_mode)); PrintFormat("Event measurement unit: %s",EnumToString((ENUM_CALENDAR_EVENT_UNIT)event.unit)); PrintFormat("Number of decimal places: %d",event.digits); PrintFormat("Event multiplier: %s",EnumToString((ENUM_CALENDAR_EVENT_MULTIPLIER)event.multiplier)); PrintFormat("Source URL: %s",event.source_url); } } } else { PrintFormat("Error! Failed to receive events for country_code=%s",country_code); PrintFormat("Error code: %d",GetLastError()); // hasNews = true; // if can't Identify set to true }
After the Update to Version 5.00 build 3042 17 Sep 2021, I'm getting the error on attachement.
Files:
Cannot get Calendar new for some countries.