Chart

View as Markdown

Chart Properties

FunctionStatusDescription
chart.bg_colorBackground color
chart.fg_colorForeground color

Chart Type Detection

FunctionStatusDescription
chart.is_heikinashiTrue on a Heikin Ashi chart (see note below)
chart.is_kagi⚠️Always false — chart type not representable
chart.is_linebreak⚠️Always false — chart type not representable
chart.is_pnf⚠️Always false — chart type not representable
chart.is_range⚠️Always false — chart type not representable
chart.is_renko⚠️Always false — chart type not representable
chart.is_standardTrue unless the chart is a non-standard type

Visible Range

FunctionStatusDescription
chart.left_visible_bar_timeLeft visible bar time
chart.right_visible_bar_timeRight visible bar time

Chart Point

FunctionStatusDescription
chart.point.copy()Copy chart point
chart.point.from_index()Create point from index
chart.point.from_time()Create point from time
chart.point.new()Create new chart point
chart.point.now()Get current chart point

Chart Point Fields

FieldStatusDescription
chart.point.indexBar index of point
chart.point.pricePrice of point
chart.point.timeTimestamp of point

Notes

  • is_heikinashi / is_standard — THE CHART TYPE IS THE TICKER. A host declares a Heikin Ashi chart by constructing PineTS with an extended ticker: new PineTS(source, 'BTCUSDT;heikinashi', 'D', …). The chart type is derived from that ticker's ;heikinashi modifier — there is no separate setting. On such a chart, chart.is_heikinashi is true, chart.is_standard is false, and syminfo.tickerid carries the modifier (so request.security(syminfo.tickerid, …) routes chart-typed data requests to the data source — see Ticker). PineTS never transforms bars: the data source of an extended ticker is expected to serve the chart-type view already (an embedding host that owns the transform, e.g. a charting library); PineTS' bundled providers strip the modifier and serve standard candles.
  • is_kagi / is_renko / is_linebreak / is_pnf / is_range — these chart types have no data source that can construct their bars, so the predicates are hardcoded false.
  • These predicates are Pine variables (bare member access, chart.is_heikinashi — no call), exposed as getters like the visible-range built-ins below.
  • left_visible_bar_time / right_visible_bar_time — In TradingView these reflect the user's UI viewport (what's scrolled into view). PineTS is renderer-agnostic, so by default they fall back to the first/last bar of the loaded marketData (i.e. "the full loaded range is the viewport"). Hosts that render PineTS output and want to model a true zoom/pan can override via PineTS.setVisibleRange(left, right). Use PineTS.usesVisibleRange() to skip viewport-change re-runs for indicators that don't reference these built-ins; PineTS.update(code) is a smart re-run helper that gates on this tag automatically.

On this page