You can use ChartChange() to load a new indicator onto a chart. The extra settings in the call to
| Property | Description |
| indicator | The class name of an indicator in the FXB.ta library, such as |
| indicatorSettings:{} | The parameters for the indicator, as specified when creating an instance of the |
For example, you can add MACD to a chart as follows. Note that the
Framework.ChartChange({
mode: "active", // or "all", or "single" plus a .chartId value
command: "load-indicator",
indicator: "MACD",
indicatorSettings: {
fast: 12,
slow: 26,
signal: 9
}
});
Similarly, you can add the Average True Range indicator to a chart:
Framework.ChartChange({
mode: "active", // or "all", or "single" plus a .chartId value
command: "load-indicator",
indicator: "ATR",
indicatorSettings: {
// The period defaults to 14 if not specified
}
});
Or, an exponential moving average:
Framework.ChartChange({
mode: "active", // or "all", or "single" plus a .chartId value
command: "load-indicator",
indicator: "EMA",
indicatorSettings: {
period: 20
}
});
In addition to indicators from the
Framework.ChartChange({
mode: "active", // or "all", or "single" plus a .chartId value
command: "load-indicator",
indicator: "PeriodSeparator", // Visual period-separator markers
indicatorSettings: {
timeframe: 86400 // … on a daily (D1) basis
}
});
The special extra indicators which can be loaded using
| indicator value | Description | indicatorSettings:{} |
| Calendar | Platform's calendar indicator, showing markers for calendar events | (none) |
| TradeHistory | Platform's trade-history indicator, showing markers for historic trades | (none) |
| PeriodSeparator | Period-separator markers | Can optionally provide a timeframe for the separators. Defaults to 86400 (D1) if omitted. |
| Fractals | Displays "fractal" markers | Can optionally provide a |
| Comparison | Overlays a second market on the chart, as a comparison line | Requires an instrumentId, such as |
| PivotPoints | Displays pivot points | Can optionally provide a |
| UDI | Loads a User Defined Indicator | Requires either a |