Skip to content

Features

Footprint and order flow

Build footprint bars from trades, and add CVD, delta, big trades, and auction markers.

Footprint series

A footprint series is fed trades, not bars. The engine builds each bar from the trades it receives, splitting volume by price level and by aggressor side. Generic OHLC setters are rejected for this kind.

Footprint
const footprint = chart.addSeries("footprint", {
  tick_size: 0.5,       // exact exchange increment; off-grid trades are rejected
  ticks_per_row: 2,     // group adjacent ticks into one row
  bar_type: "time",     // "time" | "trades" | "volume" | "range"
  interval_seconds: 60,
  cell_mode: "bid_ask",
});

footprint.set_trades([
  { timestamp_micros: 1735689600_000000, price: 94210.5, volume: 0.42, aggressor: "buy" },
  { timestamp_micros: 1735689601_250000, price: 94210.0, volume: 1.1, aggressor: "sell" },
]);

// live
footprint.update_trade({ timestamp_micros: 1735689602_000000, price: 94211, volume: 0.2, aggressor: "buy" });
footprint.fit_viewport();

Footprint timestamps are microseconds, unlike bar data. Cell modes are bid_ask, total, delta, profile_in_bar, volume_ladder, horizontal_imbalance, and bid_ask_histogram. Imbalances use imbalance_ratio, imbalance_minimum_volume, and stacked_imbalance_levels. Read bars back with footprint_bars() and footprint_bar(): OHLC, price levels, point of control, delta, and volume by side.

Trade streams

A trade stream is one bounded tape per instrument. Footprints, cumulative volume delta, delta histograms, and big trades all bind to the same stream, so you send each trade once.

Order-flow studies
const stream = chart.add_trade_stream("BTC-USD", { tick_size: 0.5 });

chart.add_cvd_series(stream, 1, "session");   // cumulative volume delta in pane 1
chart.add_delta_series(stream, 2);            // per-bar delta histogram in pane 2
chart.add_big_trades(candles, stream);        // large trades as bubbles over price

CVD resets per session, runs continuously, or starts at an anchor time, and draws as candles (the default) or a line. Runtime-only auction markers flag unfinished auctions, exhaustion, and absorption through add_auction_markers.