Indicator reference

Every indicator class available in agent code, 80 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.
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.
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.
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.
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.
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.
Divergences Momentum and oscillators Finds regular and hidden divergences between price swings and a target series (an oscillator), using Swings pivots.
DPO Momentum and oscillators Detrended price oscillator: close − SMA(period) as it was period / 2 + 1 candles ago.
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).
KDJ Momentum and oscillators KDJ oscillator: raw stochastic dK, then K and D smoothed with a 1/3 weight, and J = 3K − 2D.
MACD Momentum and oscillators Moving average convergence divergence: macd = fast MA − slow MA, signal = MA(macd), histogram = macd − signal.
Momentum Momentum and oscillators Momentum: value − value length candles ago.
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.
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.
TRIX Momentum and oscillators TRIX: the one-candle change of a triple EMA of the log price, times 10,000.
WilliamsPercentR Momentum and oscillators Williams %R: 100 × (close − highest high) / (highest high − lowest low) over length, between −100 and 0.
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.
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.
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.
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.
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.
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.
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