Indicators

Turn a Strategy Studio graph into a custom indicator rendered on the TradingView chart, and the full library of built-in indicators.

Two things share this page: the built-in indicator library, and how to turn a graph into a custom chart indicator.

The indicator library

Every ind.* node, by family. Full ports/params are in the Node Reference. Two cross-cutting features:

  • value input accepts a number or a candle. When you wire a candle, the source param picks close / open / high / low / volume (default close). Candle-only indicators (ATR, ADX, Donchian, Keltner, OBV, etc.) require a candle.
  • Per-node timeframe override. Every indicator carries an optional timeframe param. Empty = the graph's global timeframe; a coarser value resamples the node onto higher-timeframe bars (e.g. a 4h RSI inside a 1h graph). It updates only on each HTF bar close. See Core Concepts → per-node timeframe.

The strategy wizard's condition picker offers every indicator below except ind.crossover (a wizard condition already compares two series). The most used ones (RSI, EMA, SMA, MACD, Bollinger Bands, ATR, Session VWAP, ADX, Stoch RSI, Supertrend) are listed first, the rest alphabetically.

Warmup & seeding

Every indicator emits NaN until its lookback is properly seeded, following TA-lib-style conventions:

  • EMA (and EMA-based bases) seed with the SMA of the first period values; Wilder indicators (RSI, ATR, ADX) seed with the Wilder average.
  • Composite indicators — MACD, ADX, DEMA, TEMA, Keltner, TSI, TRIX, Ichimoku, PSAR — stay NaN through their full multi-stage warmup instead of emitting finite-but-wrong values from bar 1. Cascaded EMAs compound: DEMA needs ~2, TEMA/TRIX ~3 seeding stages; ADX's first value lands around bar 2 × period.
  • ind.highest / ind.lowest emit NaN (never ±Infinity) on an empty or unfilled window; with offset > 0 they need period + offset samples.
  • RSI has exact edge handling: all-gains → 100, all-losses → 0, fully flat → neutral 50.

NaN compares false against everything, so warmup can never fire a trade — but size your graph's warmup bars to the slowest indicator or your run will start blind.

The sampled indicators (roc, momentum, zscore, stdev, highest, lowest) default to sampleMode: barClose — one sample per bar close, so "period N" means N bars identically in backtest, paper, and live; change (per-tick) is an explicit opt-in.

Moving averages

ind.sma, ind.ema, ind.wma, ind.dema, ind.tema, ind.hma, ind.kama, ind.vwma (volume-weighted, needs a candle; source can also be hlc3).

VWAP

  • Rolling VWAP over the last N bars: ind.vwma with source: hlc3.
  • ind.vwapSession — VWAP anchored to the start of each UTC day, reset at the daily boundary (typical price (h+l+c)/3).

Oscillators & momentum

ind.rsi, ind.stochRsi, ind.stoch, ind.cci, ind.willr, ind.mfi, ind.tsi, ind.trix (triple-smoothed EMA rate-of-change %), ind.roc, ind.momentum, ind.macd.

Statistics

ind.zscore, ind.stdev, ind.rvol (relative volume vs the N-bar average; >1 = busy), ind.linreg (least-squares line; outputs the endpoint value and per-bar slope), ind.highest, ind.lowest (both take an offset param: offset: 1 excludes the current bar, giving the *prior* N-bar extreme breakout logic needs), ind.realizedVol (annualized volatility of log returns, plus perBar), ind.percentRank (where the value sits in its own N-bar range, 0–100).

Bands & channels

ind.bollinger (basis/upper/lower/bandwidth/%b), ind.keltner, ind.donchian (also has the offset param for prior-channel breakouts).

Trend & structure

ind.atr, ind.adx, ind.aroon, ind.vortex, ind.supertrend, ind.psar, ind.obv, ind.ichimoku, ind.pivots (confirmed swing highs/lows, right bars late, with a pulse on each new one).

Two of these follow their standard charting definitions exactly:

  • ind.supertrend uses the standard final-band logic: a band ratchets only while price stays on its side and resets to the basic band once the previous close breaks through it — matching TradingView, not a monotonic ratchet.
  • ind.ichimoku's senkouA/senkouB outputs are the displaced cloud: the value AT the current bar, computed displacement bars ago (default 26, the standard definition). They stay NaN until the displacement buffer fills, so nothing trades against a partial cloud.

Crossing

  • ind.crossover — cross is a signal<number> (+1 up-cross bar, −1 down-cross bar, 0 otherwise) and above is a sustained boolean.
  • For a clean boolean event, prefer logic.cross (up/down/any).
  • All cross nodes step only on bar-close ticks (Pine semantics): intra-bar ticks emit no event and hold the last level, so paper/live never see crosses a backtest wouldn't. With an HTF override, ind.crossover fires at most once per HTF bucket.

---

Indicator graphs (chart overlays)

An indicator graph is a Studio graph whose debug.plot nodes render as lines on the main chart, integrated into the TradingView custom-indicator framework.

Build one

  1. New → Blank indicator (or set Graph type → indicator in the Inspector).
  2. Wire data → indicators → debug.plot nodes. Each plot node becomes one line; its series param is the line title and color picks the hue (primary/green, warn/amber, danger/red, info/sky, violet). placement chooses overlay-on-price or a separate panel.
  3. Numeric-series indicators take a raw number stream or a full candle on value; with a candle, the source param picks the field.
  4. An indicator graph with no debug.plot node is a validation error — add at least one.

Add to the chart

When the graph type is indicator and validation is clean, the toolbar shows Export to chart. Click it to copy the graph into your chart indicator library. Open the chart's Indicators → Imported dialog to enable it. Re-click Export to chart after edits to refresh (idempotent by graph id).

How it computes

Indicators are recomputed off the main thread, mirroring the Pine custom-indicator pipeline:

  • TradingView calls the indicator's main() per bar. Values come from a synchronous cache keyed by bar time.
  • On a cache miss, bars are buffered and a debounced backtest run is dispatched to the studio engine worker over the chart's coin + timeframe. Any node coin set to Current market resolves to the chart coin; literal coins stay literal, so cross-coin overlays can mix the chart market with fixed reference markets.
  • The worker emits plot events; they're bucketed by time into the cache, and the chart study is force-repainted so the lines appear.

Limits (v1)

  • Early bars render blank until enough history accumulates (warmup = 0; the full collected series is recomputed each flush).
  • Editing the source graph doesn't auto-refresh an already-added chart indicator — re-export to update.
  • The chart timeframe snaps to the nearest Studio timeframe (1m/5m/15m/1h/4h/1d) for the replay, and overrides the graph's data.timeframe node while the study is on-chart.