The widgetId value can then be used in calls to ChartChange() by specifying
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
}
});