3.8.5.2Passing the ID of a trading chart to ChartChange()

The widgetId value can then be used in calls to ChartChange() by specifying mode: "single" and the ID. For example:

Framework.CreateDialog({

type: "chart",

}, function (MsgDialog) {

if (MsgDialog.widgetId) {

// Initial callback on creation

// Use ChartChange() to add an indicator to the chart

Framework.ChartChange({

mode: "single", // Act on a single chart, specified by chartId

chartId: MsgDialog.widgetId, // Provide the ID for ChartChange() to act on

command: "load-indicator",

indicator: "ATR",

indicatorSettings: {period: 23}

});

} else {

// Subsequent callback from dialog after creation

}

});