3.15Economic calendar

The MyTrader framework provides access to an economic calendar - unless the hasCalendar property of Framework.Environment indicates that no calendar is available in the current platform.

Widgets, scripts, and UDIXes can request the calendar using Framework.RequestCalendar(). This responds, asynchronously, with an object containing a calendarItems[] array. There can be further callbacks into the asynchronous handler function when items are added to the calendar, or when existing items are updated with new information. For example:

Framework.RequestCalendar(function (Msg) {

// This function can be called multiple times.

// There will be an initial asynchronous call with the current state of the calendar,

// potentially followed by updates.

// Msg.calendarItems[] is an array of new and/or updated items

});

Each item in the calendar array has the following properties. Note: there can be variation in the data depending on the source of the calendar. Only the ID, title, and timestamp are absolutely guaranteed to be available across all calendar providers.

Property

Description

id

Unique ID of the calendar event

title

Description of the event (e.g. NFP)

timestamp

Time of the event (in UTC milliseconds)

allday

Boolean indicating whether the event is an all-day event such as a holiday

impact

Expected market impact of the event: 0 = low, 1 = medium, 2 = high

currencies

Array of ISO currency codes related to the event. For example, currencies: ["USD", "JPY"]. Some calendar sources may use special identifiers such as "*" or "ALL" to indicate events which apply globally.

previous
forecast

actual

Where applicable (e.g. employment figures), the previous and forecast values for the event, plus the actual value as an update after the event. The format of these values is not standardised and depends on the calendar source; they may be either textual or numeric. Some calendar sources may not provide post-event updates with the actual values, and some sources may not have this data at all.