Skip to main content

Module indicators

Module indicators 

Source
Expand description

Built-in indicators. Every indicator implements crate::Indicator.

Modules are organised internally by category (trend, momentum, volatility, volume) but every public name is also re-exported flat from this module and from the crate root for convenience.

Structs§

AcceleratorOscillator
Accelerator Oscillator — Bill Williams’ gauge of momentum’s acceleration.
Adl
Accumulation/Distribution Line — Marc Chaikin’s cumulative volume-flow indicator.
Adx
Wilder’s Average Directional Index.
AdxOutput
ADX output: the three Wilder lines.
Aroon
Aroon indicator: tracks how many bars since the highest high and lowest low inside a period + 1-bar window. Returned as a percentage.
AroonOscillator
Aroon Oscillator — the single-line difference AroonUp − AroonDown.
AroonOutput
Aroon output: up and down strengths in [0, 100].
Atr
Average True Range with Wilder smoothing.
AtrTrailingStop
ATR Trailing Stop — a stop level that trails price by a fixed ATR multiple and ratchets in the direction of the trend.
AwesomeOscillator
Awesome Oscillator: SMA(median_price, 5) - SMA(median_price, 34).
BalanceOfPower
Balance of Power — where the close settled within the bar’s range relative to the open.
BollingerBands
Bollinger Bands with SMA middle band and population standard deviation envelopes.
BollingerBandwidth
Bollinger Bandwidth — the width of the Bollinger Bands relative to the middle band.
BollingerOutput
Bollinger Bands output.
Cci
Commodity Channel Index.
ChaikinMoneyFlow
Chaikin Money Flow — Marc Chaikin’s period-window money-flow oscillator.
ChaikinOscillator
Chaikin Oscillator — the MACD of the Accumulation/Distribution Line.
ChaikinVolatility
Chaikin Volatility — the rate of change of a smoothed high-low spread.
ChandeKrollStop
Chande Kroll Stop — Tushar Chande and Stanley Kroll’s two-stage ATR stop.
ChandeKrollStopOutput
Chande Kroll Stop output: the long-side and short-side stop levels.
ChandelierExit
Chandelier Exit — Chuck LeBeau’s ATR trailing stop, hung from the highest high (for longs) or the lowest low (for shorts) of the lookback window.
ChandelierExitOutput
Chandelier Exit output: the long-side and short-side trailing stops.
ChoppinessIndex
Choppiness Index — is the market trending or just chopping sideways?
Cmo
Chande Momentum Oscillator — Tushar Chande’s bounded momentum gauge.
Coppock
Coppock Curve — Edwin Coppock’s long-term momentum indicator.
Dema
Double Exponential Moving Average: 2 * EMA - EMA(EMA).
Donchian
Donchian Channels: rolling highest high / lowest low envelopes.
DonchianOutput
Donchian Channels output.
Dpo
Detrended Price Oscillator — strips the trend out of price to expose its shorter cycles.
EaseOfMovement
Richard Arms’ Ease of Movement — how far price travels per unit of volume.
Ema
Exponential Moving Average with smoothing factor alpha = 2 / (period + 1).
ForceIndex
Alexander Elder’s Force Index — price change scaled by volume, EMA-smoothed.
HistoricalVolatility
Historical Volatility — the annualised standard deviation of log returns.
Hma
Hull Moving Average: WMA(2 * WMA(n/2) - WMA(n), sqrt(n)).
Kama
Kaufman’s Adaptive Moving Average.
Keltner
Keltner Channels: an EMA centerline with bands sized by ATR.
KeltnerOutput
Keltner Channels output.
LinRegAngle
Linear Regression Angle — the slope of the rolling least-squares fit, expressed as an angle in degrees.
LinRegSlope
Linear Regression Slope — the slope of a rolling least-squares fit.
LinearRegression
Linear Regression — the endpoint of a rolling least-squares fit.
MacdIndicator
MACD = EMA(fast) − EMA(slow), with a signal EMA on top.
MacdOutput
MACD output: the three classic series at a given step.
MassIndex
Mass Index — Donald Dorsey’s range-expansion indicator.
MedianPrice
Median Price — the bar’s (high + low) / 2.
Mfi
Money Flow Index: a volume-weighted version of RSI.
Mom
Momentum: the raw price change over period bars, price_t − price_{t−period}.
Natr
Normalized Average True Range — Atr expressed as a percentage of price.
Obv
On-Balance Volume: a cumulative signed-volume series.
PercentB
Bollinger %b — where price sits within the Bollinger Bands.
Pmo
Price Momentum Oscillator — Carl Swenlin’s DecisionPoint PMO line.
Ppo
Percentage Price Oscillator — MACD expressed as a percentage.
Psar
Parabolic Stop And Reverse.
Roc
Rate of Change as a percentage: (close - close[period]) / close[period] * 100.
RollingVwap
Rolling-window VWAP: a finite-memory variant for bots that don’t want unbounded accumulation.
Rsi
Relative Strength Index (Wilder, 1978).
Sma
Simple Moving Average over a fixed window.
Smma
Smoothed Moving Average — Wilder’s running moving average, also known as RMA.
StdDev
Rolling population standard deviation over the last period values.
StochRsi
Stochastic RSI — the Stochastic Oscillator formula applied to the RSI series instead of to price.
Stochastic
Fast Stochastic Oscillator.
StochasticOutput
Stochastic Oscillator output.
SuperTrend
SuperTrend — an ATR-banded trailing stop that flips sides on a close through the band.
SuperTrendOutput
SuperTrend output: the trailing-stop level and the trend direction.
T3
Tillson’s T3 — a six-fold cascaded EMA recombined with a volume factor v.
Tema
Triple Exponential Moving Average: 3 * EMA1 - 3 * EMA2 + EMA3, where EMA2 = EMA(EMA1) and EMA3 = EMA(EMA2).
Trima
Triangular Moving Average — a simple moving average applied twice, which triangular-weights the window so the middle bars carry the most weight and the edges the least.
Trix
TRIX: the 1-period percent rate of change of a triple-smoothed EMA.
TrueRange
True Range — the single-bar building block of every ATR-based indicator.
Tsi
True Strength Index — William Blau’s double-smoothed momentum oscillator.
TypicalPrice
Typical Price — the bar’s (high + low + close) / 3.
UlcerIndex
Ulcer Index — Peter Martin’s downside-only volatility / risk measure.
UltimateOscillator
Ultimate Oscillator — Larry Williams’ three-timeframe momentum oscillator.
VerticalHorizontalFilter
Vertical Horizontal Filter — Adam White’s trend-versus-range gauge.
VolumePriceTrend
Volume-Price Trend — a cumulative volume line weighted by percentage price change.
Vortex
Vortex Indicator — Botes & Siepman’s pair of oscillators (VI+, VI−) that capture the relationship between two consecutive bars.
VortexOutput
Vortex Indicator output: the two directional movement lines.
Vwap
Cumulative session VWAP. Call Indicator::reset at the start of each session (e.g. trading-day boundary) to restart the accumulation.
Vwma
Volume-Weighted Moving Average over a rolling window of period candles.
WeightedClose
Weighted Close — the bar’s (high + low + 2·close) / 4.
WilliamsR
Williams %R: -100 * (HH - close) / (HH - LL) over the lookback window.
Wma
Weighted Moving Average with linear weights 1, 2, ..., period.
ZScore
Z-Score — how many standard deviations the latest price sits from its rolling mean.
Zlema
Zero-Lag Exponential Moving Average (Ehlers & Way).