# Kline streams

## Stream Description

Live candles are built **from the tick stream as it arrives**. Historical candles come from
[`GET /v1/klines`](/market-data/klines-candlestick-data.md), which is built from the trade
server's own bars.

## Stream Name

`<SYMBOL>@kline_<interval>`

**Intervals:** `1m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `1d`

## Update Speed

on every tick that changes the candle, plus a final message when the candle closes.

## Response Example

```json
{"e":"kline","E":1789012345678,"s":"XAUUSD","k":{"t":1789012320000,"T":1789012379999,"s":"XAUUSD","i":"1m","o":"2331.02","c":"2331.15","h":"2331.40","l":"2330.95","v":38,"n":38,"x":false}}
```

| Field | Type | Description |
| - | - | - |
| `e` | STRING | `"kline"` |
| `E` | LONG | Event time, Unix ms. |
| `s` | STRING | Symbol. |
| `k` | OBJECT | The candle. |
| `k.t` | LONG | Candle open time, Unix ms. |
| `k.T` | LONG | Candle close time (last ms of the interval), Unix ms. |
| `k.s` | STRING | Symbol. |
| `k.i` | STRING | Interval. |
| `k.o` | DECIMAL | Open. |
| `k.c` | DECIMAL | Close — the latest price while `x` is `false`. |
| `k.h` | DECIMAL | High. |
| `k.l` | DECIMAL | Low. |
| `k.v` | LONG | Tick volume: ticks counted in the candle so far. |
| `k.n` | LONG | Number of ticks. Identical to `k.v` — MT5's volume for most instruments **is** the tick count. Both are present for Binance shape compatibility. |
| `k.x` | BOOLEAN | `true` on the final message for a closed candle. |

**Notes**

- Prices are **bid** prices, matching MT5 chart convention.
- Real traded volume is not on this stream. `GET /v1/klines` carries it as `realVolume`, and it is
  `0` on most forex and CFD symbols.
- Candle buckets are aligned to the **Unix epoch in UTC**. `1d` candles open at 00:00 UTC, which is
  not the broker's trading day — the same caveat as the REST endpoint.
- A candle whose interval sees no ticks is not emitted. Gaps are normal over weekends and closures.
- Candles only exist from the moment the service starts tracking the symbol. Backfill from
  `GET /v1/klines` and then switch to the stream; expect the first live candle after you subscribe
  to be partial.
