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:
valueinput accepts a number or a candle. When you wire acandle, thesourceparam picksclose/open/high/low/volume(defaultclose). Candle-only indicators (ATR, ADX, Donchian, Keltner, OBV, etc.) require acandle.- Per-node
timeframeoverride. Every indicator carries an optionaltimeframeparam. 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
periodvalues; Wilder indicators (RSI, ATR, ADX) seed with the Wilder average. - Composite indicators — MACD, ADX, DEMA, TEMA, Keltner, TSI, TRIX, Ichimoku, PSAR — stay
NaNthrough 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 bar2 × period. ind.highest/ind.lowestemitNaN(never ±Infinity) on an empty or unfilled window; withoffset > 0they needperiod + offsetsamples.- RSI has exact edge handling: all-gains →
100, all-losses →0, fully flat → neutral50.
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.vwmawithsource: 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.supertrenduses 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'ssenkouA/senkouBoutputs are the displaced cloud: the value AT the current bar, computeddisplacementbars ago (default 26, the standard definition). They stayNaNuntil the displacement buffer fills, so nothing trades against a partial cloud.
Crossing
ind.crossover—crossis asignal<number>(+1 up-cross bar, −1 down-cross bar, 0 otherwise) andaboveis 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.crossoverfires 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
- New → Blank indicator (or set Graph type → indicator in the Inspector).
- Wire data → indicators →
debug.plotnodes. Each plot node becomes one line; itsseriesparam is the line title andcolorpicks the hue (primary/green, warn/amber, danger/red, info/sky, violet).placementchooses overlay-on-price or a separate panel. - Numeric-series indicators take a raw number stream or a full candle on
value; with a candle, thesourceparam picks the field. - An indicator graph with no
debug.plotnode 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
plotevents; 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.timeframenode while the study is on-chart.