Appearance
IndiChart Channel Service
IndiChart is a dxLink channel service that streams candle snapshots and updates together with aligned indicator calculation results. Chart clients subscribe to a symbol and receive batched market data plus indicator payloads suitable for rendering.
What it does
- Open a channel with zero or more indicator scripts in the channel request parameters.
- Compile indicators asynchronously and emit
INDICHART_INDICATORSwith metadata (inputs, outputs, enabled/disabled state). - Configure aggregation, candle fields, and data format via
INDICHART_SETUP. - Subscribe to a symbol and time range via
INDICHART_SUBSCRIPTION. - Stream candle snapshots, indicator snapshots, and live updates.
IndiChart runs each indicator script on every candle batch.
Channel lifecycle
text
CHANNEL_REQUEST (INDICHART/1, init params)
│
▼
INDICHART_INDICATORS ── compile result (per indicator: enabled or error)
│
▼
INDICHART_SETUP ── optional client configuration
│
▼
INDICHART_CONFIG ── applied configuration
│
▼
INDICHART_SUBSCRIPTION ── symbol + fromTime (+ per-indicator input overrides)
│
▼
INDICHART_CONFIG ── configuration echoed with resolved candle fields
│
├── INDICHART_CANDLE_SNAPSHOT (one or more, pending batches)
├── INDICHART_INDICATORS_SNAPSHOT (zero or more data batches)
├── INDICHART_INDICATORS_SNAPSHOT (empty end marker, pending=false)
└── INDICHART_UPDATE (live candles + indicators)Snapshot ordering, update batching, and indicator payload shapes are defined in IndiChart Protocol.
Opening a channel
Pass indicator scripts in the channel init parameters:
json
{
"indicators": {
"rsi": {
"lang": "dxscript-js",
"content": "const n = input.double(\"length\", 14);\nfunction onTick() {\n spline(ta.rsi(close, n), {title: \"RSI\"});\n}"
}
}
}Each key is the indicator name used in outbound data payloads. Optional space and feed fields select market-data routing when the host supports multiple feeds.
A channel with no indicators object streams candles only.
Setup
Send INDICHART_SETUP to negotiate:
| Field | Description |
|---|---|
acceptAggregationPeriod | Aggregation period in seconds (e.g. 60 for one minute) |
acceptCandleFields | Subset of candle fields to include (e.g. ["open","high","low","close","volume"]) |
acceptDataFormat | FULL or COMPACT market-data encoding |
The server responds with INDICHART_CONFIG containing the applied values. After the first INDICHART_SUBSCRIPTION, another INDICHART_CONFIG is sent with resolved default candle fields.
Subscription
json
{
"subscription": {
"symbol": "AAPL{=d}",
"fromTime": 0
},
"indicatorsParameters": {
"rsi": {
"length": 21
}
}
}symbol— dxFeed candle symbol (e.g.AAPL{=d},IBM{=h}).fromTime— start time in epoch milliseconds;0requests the maximum available history within server limits.indicatorsParameters— optional per-indicator input overrides keyed by indicator name.
Sending a new subscription cancels the previous one and triggers indicator re-initialization when input parameters change.
Messages
| Message | Direction | Description |
|---|---|---|
INDICHART_SETUP | Client → server | Negotiate aggregation, fields, format |
INDICHART_SUBSCRIPTION | Client → server | Symbol, fromTime, input overrides |
INDICHART_INDICATORS | Server → client | Compile/init status and declared metadata per indicator |
INDICHART_CONFIG | Server → client | Applied chart configuration |
INDICHART_CANDLE_SNAPSHOT | Server → client | Historical candle batches |
INDICHART_INDICATORS_SNAPSHOT | Server → client | Historical indicator batches |
INDICHART_UPDATE | Server → client | Live candle and indicator updates |
Data messages (INDICHART_CANDLE_SNAPSHOT, INDICHART_INDICATORS_SNAPSHOT, INDICHART_UPDATE) are specified in IndiChart Protocol.
Indicator status
INDICHART_INDICATORS carries one entry per indicator. Each entry includes:
enabled— whether compilation and initialization succeeded.meta—titleandshortTitlewhen declared byindicator().inParameters— declaredinput()parameters with types and defaults.outputs,splines,backgroundColors,barColors,shapes— declared output layer metadata.scriptError— structured error whenenabledisfalse.
When every indicator fails or no indicators are configured, the indicators field may be absent.
Client libraries
@dxfeed/dxlink-indichart— low-level dxLink channel client.