3.8.3Instrument and timeframe context for trading charts

When displaying a trading chart as a dialog or in an iframe, the instrument and timeframe for the chart can be provided via a context:{} parameter for the call to CreateDialog() or CreateSubWidget().

Properties are as follows. Both are optional, and the entire context:{} block is optional and can be omitted.

Property

Description

instrumentId

ID of the FXB.Instrument to display. Optional. Has a broker-dependent default if unspecified (usually "EUR/USD").

timeframe

Timeframe for the chart. Optional. Has a broker-dependent default if unspecified (usually 3600; H1).

For example:

// Explicit instrument and timeframe

Framework.CreateDialog({

type: "chart",

settings: { … },

context: {instrumentId: "GBP/USD", timeframe: 3600}

});

// Explicit instrument and default timeframe (usually H1)

Framework.CreateDialog({

type: "chart",

settings: { … },

context: {instrumentId: "GBP/USD"}

});

// Unlikely in real life, but permitted: let the platform choose both the

// instrument and timeframe

Framework.CreateDialog({

type: "chart",

settings: { … },

context: {} // Or simply omit context:{} entirely

});