Trend indicators answer two questions: which direction is price moving, and how strong is that move? They range from simple moving averages to multi-component systems like Ichimoku and ADX.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ta4j/ta4j/llms.txt
Use this file to discover all available pages before exploring further.
Moving averages
SMAIndicator — Simple Moving Average
SMAIndicator — Simple Moving Average
SMAIndicator(Indicator<Num> indicator, int barCount)Calculates the arithmetic mean of the last barCount values. The simplest and most widely used average; every bar has equal weight.input.getCountOfUnstableBars() + barCount - 1EMAIndicator — Exponential Moving Average
EMAIndicator — Exponential Moving Average
EMAIndicator(Indicator<Num> indicator, int barCount)Applies exponentially decreasing weights with smoothing factor 2 / (barCount + 1). Reacts faster than SMA to recent price changes. Resets gracefully on NaN input.barCountWMAIndicator — Weighted Moving Average
WMAIndicator — Weighted Moving Average
WMAIndicator(Indicator<Num> indicator, int barCount)Assigns linearly increasing weights so the most recent bar has the highest weight. More responsive than SMA but smoother than EMA.input.getCountOfUnstableBars() + barCount - 1HMAIndicator — Hull Moving Average
HMAIndicator — Hull Moving Average
HMAIndicator(Indicator<Num> indicator, int barCount)Combines two WMAs to dramatically reduce lag while maintaining smoothness: WMA(2 * WMA(n/2) - WMA(n), sqrt(n)). Well suited for fast-moving markets.DMAIndicator — Displaced Moving Average
DMAIndicator — Displaced Moving Average
DMAIndicator(Indicator<Num> indicator, int barCount, int displacement)An SMA shifted forward (displacement > 0) or backward (displacement < 0) in time. Positive displacement projects the average ahead to anticipate support/resistance.KAMAIndicator — Kaufman's Adaptive Moving Average
KAMAIndicator — Kaufman's Adaptive Moving Average
KAMAIndicator(Indicator<Num> price)— defaults: efficiency ratio period 10, fast 2, slow 30KAMAIndicator(Indicator<Num> price, int barCountEffectiveRatio, int barCountFast, int barCountSlow)
price.getCountOfUnstableBars() + barCountEffectiveRatioDoubleEMAIndicator — Double EMA (DEMA)
DoubleEMAIndicator — Double EMA (DEMA)
DoubleEMAIndicator(Indicator<Num> indicator, int barCount)Reduces EMA lag by applying EMA twice: 2 * EMA(n) - EMA(EMA(n)).TripleEMAIndicator — Triple EMA (TEMA)
TripleEMAIndicator — Triple EMA (TEMA)
TripleEMAIndicator(Indicator<Num> indicator, int barCount)Further reduces lag: 3 * EMA - 3 * EMA(EMA) + EMA(EMA(EMA)).MMAIndicator — Modified/Wilder's Moving Average
MMAIndicator — Modified/Wilder's Moving Average
MMAIndicator(Indicator<Num> indicator, int barCount)Wilder’s smoothed moving average with multiplier 1 / barCount. Used internally by RSI, ATR, and ADX.Additional averages
Additional averages
| Class | Description |
|---|---|
ATMAIndicator(indicator, barCount) | Adaptive Triangular MA |
EDMAIndicator(indicator, barCount) | Exponentially Displaced MA |
JMAIndicator(indicator, barCount, phase, power) | Jurik MA |
KiJunV2Indicator(indicator, barCount) | Kijun-based MA variant |
LSMAIndicator(indicator, barCount) | Least Squares MA |
LWMAIndicator(indicator, barCount) | Linear Weighted MA |
MCGinleyMAIndicator(indicator, barCount) | McGinley Dynamic |
SGMAIndicator(indicator, barCount) | Savitzky-Golay MA |
SMMAIndicator(indicator, barCount) | Smoothed MA |
TMAIndicator(indicator, barCount) | Triangular MA |
VIDYAIndicator(indicator, barCount) | Variable Index Dynamic Average |
VWMAIndicator(indicator, barCount) | Volume-Weighted MA |
WildersMAIndicator(indicator, barCount) | Wilder’s MA alias |
ZLEMAIndicator(indicator, barCount) | Zero-Lag EMA |
MACD
MACDIndicator — Moving Average Convergence Divergence
MACDIndicator — Moving Average Convergence Divergence
MACDIndicator(Indicator<Num> indicator)— defaults: short 12, long 26MACDIndicator(Indicator<Num> indicator, int shortBarCount, int longBarCount)
MACDVIndicator — MACD with Volume
MACDVIndicator — MACD with Volume
MACDVIndicator(BarSeries series, int shortBarCount, int longBarCount)Volume-weighted MACD variant.ADX — Average Directional Index
ADXIndicator
ADXIndicator
ADXIndicator(BarSeries series, int barCount)— same period for DI and ADX smoothingADXIndicator(BarSeries series, int diBarCount, int adxBarCount)
PlusDIIndicator and MinusDIIndicator
PlusDIIndicator and MinusDIIndicator
PlusDIIndicator(BarSeries series, int barCount)— +DI (upward directional movement)MinusDIIndicator(BarSeries series, int barCount)— -DI (downward directional movement)
Aroon
AroonUpIndicator and AroonDownIndicator
AroonUpIndicator and AroonDownIndicator
AroonUpIndicator(BarSeries series, int barCount)— time since highest high, scaled 0–100AroonUpIndicator(Indicator<Num> highPriceIndicator, int barCount)— custom high sourceAroonDownIndicator(BarSeries series, int barCount)— time since lowest low, scaled 0–100
AroonOscillatorIndicator
AroonOscillatorIndicator
AroonOscillatorIndicator(BarSeries series, int barCount)AroonUp - AroonDown. Oscillates between -100 and +100. Positive values favor uptrend; negative favor downtrend.Ichimoku Cloud
All Ichimoku components accept aBarSeries and use standard defaults when called with no period arguments.
IchimokuTenkanSenIndicator — Conversion line
IchimokuTenkanSenIndicator — Conversion line
IchimokuTenkanSenIndicator(BarSeries series)— default period 9IchimokuTenkanSenIndicator(BarSeries series, int barCount)
(highest high + lowest low) / 2 over barCount bars.IchimokuKijunSenIndicator — Base line
IchimokuKijunSenIndicator — Base line
IchimokuKijunSenIndicator(BarSeries series)— default period 26IchimokuKijunSenIndicator(BarSeries series, int barCount)
IchimokuSenkouSpanAIndicator — Leading Span A
IchimokuSenkouSpanAIndicator — Leading Span A
IchimokuSenkouSpanAIndicator(BarSeries series)— tenkan 9, kijun 26, offset 26IchimokuSenkouSpanAIndicator(BarSeries series, int barCountConversionLine, int barCountBaseLine)IchimokuSenkouSpanAIndicator(BarSeries series, IchimokuTenkanSenIndicator conversionLine, IchimokuKijunSenIndicator baseLine, int offset)
(Tenkan-sen + Kijun-sen) / 2 plotted offset bars ahead. Forms the top or bottom of the Kumo cloud.IchimokuSenkouSpanBIndicator — Leading Span B
IchimokuSenkouSpanBIndicator — Leading Span B
IchimokuSenkouSpanBIndicator(BarSeries series)— period 52, offset 26IchimokuSenkouSpanBIndicator(BarSeries series, int barCount)IchimokuSenkouSpanBIndicator(BarSeries series, int barCount, int offset)
(highest high + lowest low) / 2 over 52 bars, plotted 26 bars ahead. Forms the opposite boundary of the cloud.IchimokuChikouSpanIndicator — Lagging Span
IchimokuChikouSpanIndicator — Lagging Span
IchimokuChikouSpanIndicator(BarSeries series)— default delay 26IchimokuChikouSpanIndicator(BarSeries series, int timeDelay)
timeDelay bars behind current price. Used to confirm trend direction by comparing the lagging span to past price.Full Ichimoku example
Full Ichimoku example
Parabolic SAR
ParabolicSarIndicator
ParabolicSarIndicator
ParabolicSarIndicator(BarSeries series)— defaults: aF 0.02, maxA 0.2, increment 0.02ParabolicSarIndicator(BarSeries series, Num aF, Num maxA)ParabolicSarIndicator(BarSeries series, Num aF, Num maxA, Num increment)
SuperTrend
SuperTrendIndicator
SuperTrendIndicator
SuperTrendIndicator(BarSeries series)— defaults: ATR period 10, multiplier 3.0SuperTrendIndicator(BarSeries series, int barCount, double multiplier)
isUpTrend(int index), isDownTrend(int index), and trendChanged(int index).SuperTrendUpperBandIndicator and SuperTrendLowerBandIndicator
SuperTrendUpperBandIndicator and SuperTrendLowerBandIndicator
SuperTrendIndicator:Other trend indicators
RAVIIndicator — Range Action Verification Index
RAVIIndicator — Range Action Verification Index
RAVIIndicator(Indicator<Num> indicator, int shortBarCount, int longBarCount)Measures the percentage difference between a short and long SMA. Filters choppy markets: high RAVI = strong trend.DistanceFromMAIndicator
DistanceFromMAIndicator
DistanceFromMAIndicator(Indicator<Num> indicator, Indicator<Num> maIndicator)Percentage distance of price from a moving average. Useful for mean-reversion strategies.AlligatorIndicator
AlligatorIndicator
AlligatorIndicator(BarSeries series)Bill Williams’ Alligator: three smoothed moving averages (Jaw, Teeth, Lips) with different periods and displacements.