- CalendarCountryById
- CalendarEventById
- CalendarValueById
- CalendarCountries
- CalendarEventByCountry
- CalendarEventByCurrency
- CalendarValueHistoryByEvent
- CalendarValueHistory
- CalendarValueLastByEvent
- CalendarValueLast
CalendarValueById
Get an event value description by its ID.
bool CalendarValueById(
|
Parameters
value_id
[in] Event value ID.
value
[out] MqlCalendarValue type variable for receiving an event description. See the example of handling calendar events.
Return Value
Returns true if successful, otherwise - false. To get information about an error, call the GetLastError() function. Possible errors:
- 4001 – ERR_INTERNAL_ERROR (general runtime error),
- 5402 – ERR_CALENDAR_NO_DATA (country is not found),
- 5401 – ERR_CALENDAR_TIMEOUT (request time limit exceeded).
Note
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.
The MqlCalendarValue structure provides methods for checking and setting values from the actual_value, forecast_value, prev_value and revised_prev_value fields. If no value is specified, the field stores LONG_MIN (-9223372036854775808).
Please note that the values stored in these field are multiplied by one million. It means that when you receive values in MqlCalendarValue using functions CalendarValueById, CalendarValueHistoryByEvent, CalendarValueHistory, CalendarValueLastByEvent and CalendarValueLast, you should check if the field values are equal to LONG_MIN; if a value is specified in a field, then you should divide the value by 1,000,000 in order to get the value. Another method to get the values is to check and to get values using the functions of the MqlCalendarValue structure.
Example:
//+------------------------------------------------------------------+
|
See also
CalendarValueHistoryByEvent, CalendarValueHistory, CalendarValueLastByEvent, CalendarValueLast