ta4j indicators implement theDocumentation 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.
Indicator<T> interface and compose into pipelines. Every indicator calculates a value for a given bar index, caches results, and declares how many initial bars it needs to warm up before producing reliable output.
The Indicator<T> interface
getValue(int index) is the primary method. Pass the index of the bar you want to evaluate. Numeric indicators return Num; pattern indicators return Boolean.
Indicator composition
Indicators are designed to accept another indicator as input, not raw price data directly. This lets you pipe one computation into another without boilerplate.getValue call and cached afterward.
Warm-up (unstable bars)
Every indicator exposesgetCountOfUnstableBars(). Indices below this threshold return NaN (for numeric indicators) or false (for boolean indicators). Always skip warm-up bars in strategies:
StandardDeviationIndicator(closePrice, 20) wrapping an EMAIndicator(close, 10) requires at least 20 + 10 - 1 = 29 bars before producing reliable output.
Helper (price) indicators
These zero-latency helpers extract OHLCV fields from each bar. They havegetCountOfUnstableBars() == 0 and are the standard inputs for other indicators.
| Class | Returns |
|---|---|
ClosePriceIndicator(BarSeries) | Close price |
OpenPriceIndicator(BarSeries) | Open price |
HighPriceIndicator(BarSeries) | High price |
LowPriceIndicator(BarSeries) | Low price |
VolumeIndicator(BarSeries) | Volume |
TypicalPriceIndicator(BarSeries) | (high + low + close) / 3 |
MedianPriceIndicator(BarSeries) | (high + low) / 2 |
Custom indicators
ExtendAbstractIndicator<T> for stateless indicators, or CachedIndicator<T> to get automatic result caching (strongly recommended for anything with a loop or recursive access).
RecursiveCachedIndicator<T> when your calculate method calls getValue(index - 1) on itself (e.g., Parabolic SAR, KAMA).
Indicator categories
Trend
Moving averages, MACD, ADX, Aroon, Ichimoku, Parabolic SAR, SuperTrend — 40+ indicators.
Momentum
RSI, Stochastic, CCI, Williams %R, ROC, TSI, Vortex — 20+ indicators.
Volatility
ATR, Bollinger Bands, Keltner Channels, Chandelier Exit, Ulcer Index — 15+ indicators.
Volume
OBV, VWAP, Chaikin Money Flow, MFI, Accumulation/Distribution — 20+ indicators.
Candlestick Patterns
Hammer, Engulfing, Doji, Morning/Evening Star, Marubozu — 25+ patterns.
Statistics
Variance, Standard Deviation, Correlation, Z-Score, Linear Regression.