TradingCharts

Non-Standard Chart Data

ChartScript indicators run on whatever chart type the user has selected. On candle / bar / line charts the series values match the raw symbol data. On non-standard chart types…

chart.is_* booleans

Inspect the chart type at runtime:

chart.is_standard     // candles / bar / line / area
chart.is_heikinashi
chart.is_renko
chart.is_kagi
chart.is_linebreak
chart.is_pnf
chart.is_range

What changes on each type

Heikin-Ashi

open, high, low, close are HA values. The raw open/close must be fetched via request.security(syminfo.tickerid, timeframe.period, [open, close]) with a tickerid that drops the chart style — or inspected via request.security(ticker.standard(), …) which returns the raw candle data.

Renko / Line Break / Kagi / Point & Figure

  • time of a brick/line/leg is the build time of the brick, not a clock-aligned bar time.
  • volume is the summed volume for the raw bars that built the brick.
  • Multiple raw bars can produce zero bricks (consolidation) or one brick (breakout), so the index is not clock-regular.

Our runtime assigns each brick a unique ordinal __ci so trade markers and shape plots stay aligned when a chart bar can span zero or many raw bars.

Range bars

Each bar has a fixed price range (volatility-based). Volumes aggregate the raw bars that filled the range.

Fetching raw bars on a non-standard chart

[rawOpen, rawHigh, rawLow, rawClose] =
    request.security(ticker.standard(syminfo.tickerid), timeframe.period,
                     [open, high, low, close])

ticker.standard(tickerid) returns a canonical secmaster key that forces the fetch to use raw candles regardless of the chart style.

Compatibility

  • plot(), plotshape(), plotcandle(), plotbar(), line.new(), label.new(), box.new() all work on every chart type. The host interprets the x coordinate as the brick/leg index, not a clock time.
  • strategy.* entries fill at the rendered bar's close (or next bar's open under process_orders_on_close = false). Make sure the brick size is coarse enough that your signal isn't painting one entry per raw tick.

See also

How it works, and the limits

  • The chart sends its chart type and settings with the subscription, and the executor transforms the raw bars server-side before the script runs — the script never sees the raw candles on these chart types (use ticker.standard in a request.security call when you need them).
  • Renko box size follows the chart. The chart resolves its box (ATR-based or fixed, after its own rounding) and sends the resolved value, so the server bricks match the ones you see. A re-resolved ATR (after scrolling far back) starts a fresh execution.
  • Not honoured server-side yet: a Renko reversal amount greater than 1, and source = high/low (bricks are built from close). Point & Figure and Kagi follow the chart's reversal settings.
  • The live bar on these chart types is the forming brick/column; barstate.isconfirmed turns true when the chart closes it.