Get the array of values for all events in a specified time range with the ability to sort by country and/or currency.
[out] MqlCalendarValue type array for receiving event values.
[in] Initial date of a time range events are selected from by a specified ID, while datetime_from < datetime_to.
[in] End date of a time range events are selected from by a specified ID. If the datetime_to is not set (or is 0), all event values beginning from the specified datetime_from date in the Calendar database are returned (including the values of future events).
[in] Country code name (ISO 3166-1 alpha-2)
[in] Country currency code name.
Returns true if successful, otherwise - false. To get information about an error, call the GetLastError() function. Possible errors:
All functions for working with the economic calendar use the trade server time (TimeTradeServer). This means that the time in the MqlCalendarValue structure and the time inputs in the CalendarValueHistoryByEvent/CalendarValueHistory functions are set in a trade server timezone, rather than a user's local time.
If the events array of fixed length was passed to the function and there was not enough space to save the entire result, the ERR_CALENDAR_MORE_DATA (5400) error is activated.
If the datetime_to is not set (or is 0), all event values beginning from the specified datetime_from date in the Calendar database are returned (including the values of future events).
For the country_code and currency filters, NULL and "" values are equivalent and mean the absence of the filter.
For country_code, the code field of the MqlCalendarCountry structure, for example "US", "RU" or "EU", should be used.
For currency, the currency field of the MqlCalendarCountry structure, for example "USD", "RUB" or "EUR", should be used.
The filters are applied by conjunction, i.e. logical 'AND' is used to select only the values of events both conditions (country and currency) are simultaneously met for.
If an event value does not have any of the fields specified below
then the value of the missing field is returned as INT64_MIN (-9223372036854775808). See the revised_prev_value field value in the example below.