3.9.19Retrieving data from a chart

You can use ChartChange() to retrieve information about a chart, using command: "get-chart-data". For example:

Framework.ChartChange({

mode: "active", // or "all", or "single" plus a .chartId value

command: "get-chart-data"

}, response => {

// Chart information is in response.result

});

The result property of the response message contains the following information about the chart:

result property

Description

chartId

ID of the chart

context

Information about the chart's symbol and timeframe

context.instrumentId

Instrument ID of the chart

context.timeframe

Timeframe of the chart

context.timezone

Time zone applied to the chart

priceStyle

Price style of the chart - candles, OHLC bars etc. One of the values listed separately in relation to creating trading charts.

candles[]

An array of the candles on the chart. Note: the date values, the ts property, of the candles are not UTC. They are specified in the chart's time zone, context.timezone. You can use the platform's conversion functions to translate the times to UTC.