Indicator reference

Every indicator class available in agent code, 125 in total, with its exact constructor, the kind of input it takes, its parameters and defaults, the value it returns, how long it takes to warm up and a snippet that passes the validator. Read Indicators first for the rules that apply to all of them.

Signatures on these pages are generated from the engine source, so they match what the validator compiles against.

Reading a signature

  • Indicator<Candle> and ICandleIndicator mean the candle series from manager.getIntervalData(...). ICandleIndicator accepts only that series itself, not a derived one.
  • Indicator<number> means a number stream whose values are never undefined: candles.close (or new PartialIndicator(candles, 'close')), candles.volume, candles.hl2, candles.hlc3, candles.ohlc4.
  • Indicator<number | undefined> also accepts the output of another indicator that warms up, such as an EMA or an RSI. You cannot pass such an output where Indicator<number> is required (for example new RSI(new EMA(...), 14) does not compile).
  • A default shown as = 20 makes the parameter optional.
  • Value type names such as MACDValue or IchimokuOutput describe the shape but are not names you can use in code: let TypeScript infer them (const value = macd.getValue();).

All indicators

Class Page What it computes
CandleIndicator Building blocks The candle series returned by manager.getIntervalData(symbol, interval).
Crossover Building blocks Detects the candle on which one series crosses another.
DerivedIndicator Building blocks Computes a value from several indicators each time all of them have updated.
Extreme Building blocks The highest and lowest value over the last period updates, the current one included.
History Building blocks Keeps the last period values of another indicator as an array, oldest first and newest last.
Index Building blocks The zero-based update count of another indicator (0 on its first value).
IteratorIndicator Building blocks Wraps an iterator that yields one value per update of its dependencies.
LambdaIndicator Building blocks Applies a pure function to each value of another indicator, without storing anything.
ManualIndicator Building blocks An indicator you feed yourself with setValue(value).
PartialIndicator Building blocks Selects one field of an indicator's object value, producing a new indicator.
Percentile Building blocks The percentile rank (0 to 100) of the current value among the last period values: the share of those values strictly below it.
PineIndicator Building blocks Runs a TradingView Pine Script indicator or strategy as-is, with TradingView's series semantics: on each candle it gives what the script shows on a chart of the same candles (plots, markers, alertconditions, labels, boxes, lines, tables and strategy orders).
ADX Moving averages and trend Average directional index with the +DI and −DI lines (Wilder smoothing), like TradingView's DMI: DI length period, ADX smoothing adxSmoothing.
ALMA Moving averages and trend Gaussian-weighted moving average of closes.
BeepBoop Moving averages and trend Trend label from a MACD(12, 26, 9) histogram sign and the candle position relative to a 50-period EMA: 'up' when the histogram is positive and the whole candle is above the EMA, 'down' for the mirror case, 'neutral' otherwise.
ChandeKrollStop Moving averages and trend Rolling extrema of ATR-adjusted high and low stops.
ChandelierExit Moving averages and trend Highest high minus ATR distance and lowest low plus ATR distance, as in the TradingView ta library.
DEMA Moving averages and trend Twice an EMA minus the EMA of that EMA.
EIT Moving averages and trend Ehlers instantaneous trendline, computed with a Hilbert-transform estimate of the dominant cycle.
Elder Moving averages and trend Elder impulse system: 'bullish' when both the EMA and the MACD histogram rose since the previous candle, 'bearish' when both fell, 'neutral' otherwise.
EMA Moving averages and trend Exponential moving average, seeded with the simple average of the first period values, then value = source × α + previous × (1 − α) with α = smoothing / (1 + period).
FIR Moving averages and trend A 4-tap finite-impulse-response smoother: (4·x0 + 3·x1 + 2·x2 + x3) / 10.
HalfTrend Moving averages and trend HalfTrend: a trend line that follows the amplitude-candle high/low averages and flips on a break, with ATR channels.
HullMovingAverage Moving averages and trend Hull moving average: WMA(2 × WMA(n/2) − WMA(n), √n), a low-lag average.
Ichimoku Moving averages and trend Ichimoku cloud: Tenkan and Kijun (midpoints of the tPeriod / kPeriod high-low range), Senkou spans A and B, and the lagging span.
KAMA Moving averages and trend Kaufman adaptive moving average: its smoothing speeds up in trends and slows down in noise, based on the efficiency ratio over length values.
LinearRegression Moving averages and trend The value, at the current candle, of the least-squares line fitted to the last period values.
LSMA Moving averages and trend Least-squares regression of the current source window, evaluated at length - 1 - offset.
MovingAverageCross Moving averages and trend Two close SMAs with a cross value only where either line crosses the other.
MVWAP Moving averages and trend Moving VWAP: the average of the last period completed VWAP windows (days, weeks or months).
RMA Moving averages and trend Wilder's running moving average (the smoothing used by RSI and ATR): seeded with a simple average, then value = (previous × (period − 1) + source) / period.
SAR Moving averages and trend Parabolic SAR: a trailing stop-and-reverse level that accelerates with the trend.
SMA Moving averages and trend Simple moving average: the arithmetic mean of the last period values.
SuperTrend Moving averages and trend SuperTrend: ATR bands around the median price (hl2 ± multiplier × ATR), flipping direction when the close crosses the active band.
TEMA Moving averages and trend Three cascaded close EMAs combined as 3 * (EMA1 - EMA2) + EMA3.
TTS Moving averages and trend Trend Trader Strategy line: a trailing level at the period extreme offset by a weighted ATR multiple, with up / down direction flags.
VIDYA Moving averages and trend Variable Index Dynamic Average: an EMA whose smoothing is scaled by the absolute Chande momentum (or by a standard-deviation ratio when useCMO is false).
VWAP Moving averages and trend Volume-weighted average price, reset at each UTC day, week (Monday) or calendar month.
VWMA Moving averages and trend Volume-weighted moving average: Σ(price × volume) / Σ(volume) over the last period candles.
WilliamsAlligator Moving averages and trend Williams Alligator: three Wilder averages of the median price (jaw, teeth, lips), each shifted forward by its offset.
WMA Moving averages and trend Linearly weighted moving average: the newest value weighs period, the oldest weighs 1.
AdvanceDeclineRatioBars Momentum and oscillators Ratio of up (including doji) to down candles; an all-up window returns the up count.
Aroon Momentum and oscillators Aroon on length + 1 candles; the newest equal high/low wins.
AroonOscillator Momentum and oscillators Aroon Up minus Aroon Down.
AverageDailyRange Momentum and oscillators Simple average of each chart candle range; the name does not imply a request for daily candles.
AwesomeOscillator Momentum and oscillators Five-bar minus 34-bar simple average of hl2.
BalanceOfPower Momentum and oscillators Candle body divided by its range; a zero range has no finite value.
BBTrend Momentum and oscillators Difference of the short and long Bollinger lower-band distance and upper-band distance, divided by the short basis, in percent.
BollingerPercentB Momentum and oscillators Position of the source within population-standard-deviation Bollinger Bands.
BullBearPower Momentum and oscillators Bull power plus bear power relative to the EMA of close.
CCI Momentum and oscillators Commodity channel index: (typical price − its mean) / (0.015 × mean deviation) over period.
ChandeMomentumOscillator Momentum and oscillators Chande momentum oscillator: 100 × (sum of gains − sum of losses) / (sum of gains + sum of losses) over length, between −100 and 100.
ChopZone Momentum and oscillators One column per candle; zone carries the rounded EMA-angle color classification.
ConnorsRSI Momentum and oscillators Mean of price RSI, consecutive-close streak RSI and the rank of the one-bar return against earlier returns.
CoppockCurve Momentum and oscillators Weighted average of the sum of the long and short close returns.
Divergences Momentum and oscillators Finds regular and hidden divergences between price swings and a target series (an oscillator), using Swings pivots.
DMI Momentum and oscillators Independent TradingView DMI: strict directional dominance, fixnan DIs and a zero-DX denominator of one.
DPO Momentum and oscillators Detrended price oscillator: close − SMA(period) as it was period / 2 + 1 candles ago.
FisherTransform Momentum and oscillators Recursive Fisher transform of hl2, with its preceding value as the trigger.
HARSI Momentum and oscillators JayRogers' Heikin Ashi RSI Oscillator: Heikin Ashi candles of zero-centred RSIs (RSI − 50, from −50 to +50; its levels are ±20 and ±30).
HistoricalVolatility Momentum and oscillators Population standard deviation of log returns, annualized with TradingView's intraday/daily versus higher-timeframe rule.
KDJ Momentum and oscillators KDJ oscillator: raw stochastic dK, then K and D smoothed with a 1/3 weight, and J = 3K − 2D.
KnowSureThing Momentum and oscillators Weighted sum of four SMA-smoothed rates of change and its SMA signal.
MACD Momentum and oscillators Moving average convergence divergence: macd = fast MA − slow MA, signal = MA(macd), histogram = macd − signal.
MassIndex Momentum and oscillators Rolling sum of candle range EMA divided by its double EMA.
Momentum Momentum and oscillators Momentum: value − value length candles ago.
PriceOscillator Momentum and oscillators Percentage price oscillator, configurable EMA/SMA signal and histogram.
PringsSpecialK Momentum and oscillators Weighted sum of twelve smoothed returns, followed by two SMA signal stages.
RankCorrelationIndex Momentum and oscillators Spearman price/time rank correlation, optional smoothing and population Bollinger Bands.
RCIRibbon Momentum and oscillators Three Spearman rank correlations of price with time, using average ranks for ties.
ROC Momentum and oscillators Rate of change, in percent: 100 × (value − value length ago) / value length ago.
RSI Momentum and oscillators Relative strength index (Wilder): 100 − 100 / (1 + average gain / average loss) over period, between 0 and 100.
RSILambda Momentum and oscillators A function (price) => rsi that returns the RSI the current candle would have if it closed at price.
SMIErgodicIndicator Momentum and oscillators Double-EMA-smoothed price change divided by double-EMA-smoothed absolute change.
SMIErgodicOscillator Momentum and oscillators Double-EMA-smoothed price change divided by double-EMA-smoothed absolute change.
SqueezeMomentum Momentum and oscillators Squeeze momentum (LazyBear): detects Bollinger bands inside Keltner channels (squeezeState: 'on') and measures momentum with a linear regression of the price against its range midpoint.
Stochastic Momentum and oscillators Stochastic oscillator: stochastic = 100 × (close − lowest low) / (highest high − lowest low) over extremePeriod, k = its kPeriod SMA, d = the dPeriod SMA of k.
StochasticMomentumIndex Momentum and oscillators Double-EMA-smoothed position in the rolling high/low range and its EMA signal.
TRIX Momentum and oscillators TRIX: the one-candle change of a triple EMA of the log price, times 10,000.
TrueStrengthIndex Momentum and oscillators Double-EMA-smoothed price change divided by double-EMA-smoothed absolute change.
UlcerIndex Momentum and oscillators Root mean square of percentage drawdowns from the rolling maximum.
UltimateOscillator Momentum and oscillators Buying pressure relative to true range over three weighted periods.
Vortex Momentum and oscillators Rolling cross-candle high/low distances divided by true range, including the first candle range.
WilliamsPercentR Momentum and oscillators Williams %R: 100 × (close − highest high) / (highest high − lowest low) over length, between −100 and 0.
WoodiesCCI Momentum and oscillators Two CCIs of close, with the preceding five-bar sign rule for histogram colors.
BBW Volatility, bands and ranges Bollinger BandWidth as TradingView plots it: the distance between the bands in percent of their basis, (upper − lower) / basis × 100 (4.5 for bands 4.5% apart).
BBWP Volatility, bands and ranges Bollinger BandWidth Percentile, The_Caretaker's: the share, in percent, of the previous lookback BBW values (fewer at first) lower than or equal to the current one.
Bollinger Volatility, bands and ranges Bollinger bands: the maPeriod SMA (mean) plus and minus stdDevMultiplier standard deviations.
Chop Volatility, bands and ranges Choppiness index: 100 × log10(Σ TR / (highest high − lowest low)) / log10(period); high values mean a sideways market.
Choppy Volatility, bands and ranges Counts monotonic runs among the last six closes: type rates the current run ('none', 'weak', 'medium', 'strong') and line counts trending candles among the last ten.
DC Volatility, bands and ranges Donchian channel MIDLINE: (highest high + lowest low) / 2 over extremePeriod candles, current included.
Envelope Volatility, bands and ranges Percentage bands around an SMA or EMA basis.
FindMarketBottom Volatility, bands and ranges Williams VIX Fix bottom finder: wvf = 100 × (highest close over 22 − low) / highest close, with Bollinger and percentile ranges; alert is true when wvf spikes above them.
KeltnerChannels Volatility, bands and ranges Keltner channels: an EMA of the close (middle) plus and minus multiplier ATRs.
Median Volatility, bands and ranges Nearest-rank median with ATR bands and an EMA of the median.
TR Volatility, bands and ranges True range: max(high − low, |high − previous close|, |low − previous close|).
ChaikinMoneyFlow Volume Chaikin money flow: Σ(money-flow volume) / Σ(volume) over length, between −1 and 1.
ChaikinOscillator Volume Fast EMA minus slow EMA of cumulative accumulation/distribution.
EaseOfMovement Volume SMA of midpoint change multiplied by the candle range and a divisor, divided by volume.
EldersForceIndex Volume EMA of close-to-close price change multiplied by volume.
KlingerOscillator Volume EMA 34 minus EMA 55 of signed volume, with an EMA 13 signal.
MFI Volume Money flow index: a volume-weighted RSI of the typical price, between 0 and 100.
OnBalanceVolume Volume On-balance volume: a running total that adds the candle volume when the price rises and subtracts it when it falls.
PercentageVolumeOscillator Volume Percentage difference between fast and slow volume averages, with a signal average and a histogram.
PMAR Volume Price-to-moving-average ratio: price / VWMA(price, volume, period).
PMARP Volume PMAR percentile, The_Caretaker's: the share, in percent, of the previous lookback PMAR values (fewer at first) not above the current one.
VolumeProfile Volume Volume profile over the last numberOfBars candles: volume per price row, point of control and value area.
BollingerBars Market structure and patterns The original candle OHLC used by Bollinger Bars: a full-width blue high-to-low rectangle under a green or red body, over the price candles.
BosNChoch Market structure and patterns Trend state machine that tracks the last break of structure and the change-of-character level.
Engulfing Market structure and patterns Two-candle engulfing pattern: 'bullish' when an up candle's body engulfs the previous down candle's body, 'bearish' for the mirror case, 'none' otherwise.
FVG Market structure and patterns Fair value gap on the last three candles: bullish when the first candle's high is below the third candle's low, bearish for the mirror case.
Heikinashi Market structure and patterns Heikin-Ashi candles: close = (o + h + l + c) / 4, open = (previous HA open + previous HA close) / 2, high/low extended to include them.
HeikinashiCandles Market structure and patterns The candles of a Heikin Ashi chart: each candle keeps its times and volume, with the Heikin-Ashi open, high, low and close.
Lunar Market structure and patterns Moon phase from a timestamp series: 0 new moon, 2 first quarter, 4 full moon, 6 last quarter (8 phases).
MarketStructure Market structure and patterns Market structure (swing highs/lows labelled HH, LH, HL, LL) with break of structure (BOS) and change of character (CHoCH) events.
OrderBlocks Market structure and patterns The most recent bullish and bearish order blocks (a down candle followed by an up candle closing above its high, and the mirror case), with 25/50/75% lines.
PivotPoints Market structure and patterns Classic floor pivot levels (P, R1 to R5, S1 to S5) computed from the previous day, week or month.
PivotsHighLow Market structure and patterns Independent high and low pivots with their original candle timestamps, emitted only when the right-hand confirmation candles have arrived.
Renko Market structure and patterns Renko bricks from a price series: a new brick forms when price travels brickSize in the trend direction; a reversal needs 2 × brickSize.
RenkoAtr Market structure and patterns Renko bricks whose size is the period ATR (Wilder), either live or frozen at its first value (anchored).
StrongCandleStructure Market structure and patterns Market structure by the Strong Candle method: valid highs and lows, break of structure (BOS) and change of character (CHoCH) on candle closes, and the demand or supply zone of each break.
SupportResistance Market structure and patterns Support and resistance levels from pivot lows/highs, with break detection confirmed by a volume oscillator.
Swings Market structure and patterns Swing highs and lows: a candle is a top (bottom) when it is the highest (lowest) of the 2 × period + 1 candles centred on it.
WilliamsFractal Market structure and patterns Williams fractals: an up fractal is a high with period lower highs on each side, a down fractal a low with period higher lows.
ZigZag Market structure and patterns TradingView's Zig Zag: alternating swing highs and lows.
Browse the documentation