Volatility indicators quantify how much price moves, independent of direction. They are used for position sizing, setting stop distances, identifying squeeze conditions, and filtering low-volatility environments where breakout strategies struggle.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.
ATR — Average True Range
ATRIndicator
ATRIndicator
ATRIndicator(BarSeries series, int barCount)ATRIndicator(TRIndicator tr, int barCount)
max(high - low, |high - prevClose|, |low - prevClose|). The standard measure of volatility used by most other volatility indicators.trIndicator.getCountOfUnstableBars() + barCountBollinger Bands
BollingerBandsMiddleIndicator
BollingerBandsMiddleIndicator
BollingerBandsMiddleIndicator(Indicator<Num> indicator)The middle band is any moving average. Typically an SMAIndicator is used. The upper and lower bands reference this indicator.BollingerBandsUpperIndicator and BollingerBandsLowerIndicator
BollingerBandsUpperIndicator and BollingerBandsLowerIndicator
BollingerBandsUpperIndicator(BollingerBandsMiddleIndicator bbm, Indicator<Num> deviation)— k = 2BollingerBandsUpperIndicator(BollingerBandsMiddleIndicator bbm, Indicator<Num> deviation, Num k)BollingerBandsLowerIndicator(BollingerBandsMiddleIndicator bbm, Indicator<Num> indicator)— k = 2BollingerBandsLowerIndicator(BollingerBandsMiddleIndicator bbm, Indicator<Num> indicator, Num k)
SMA + k × StdDev; lower band = SMA - k × StdDev. The standard deviation indicator is typically a StandardDeviationIndicator.BollingerBandWidthIndicator
BollingerBandWidthIndicator
BollingerBandWidthIndicator(BollingerBandsUpperIndicator bbu, BollingerBandsMiddleIndicator bbm, BollingerBandsLowerIndicator bbl)(upper - lower) / middle × 100. Measures how wide the bands are relative to the middle. Squeeze conditions (low bandwidth) often precede significant breakouts.PercentBIndicator — %B
PercentBIndicator — %B
PercentBIndicator(Indicator<Num> indicator, int barCount, double k)Measures where price sits within the Bollinger Bands: 0 = at lower band, 1 = at upper band, 0.5 = at middle. Values above 1 or below 0 indicate price is outside the bands.Using BollingerBandFacade for convenience
Using BollingerBandFacade for convenience
BollingerBandFacade wires all four components together in one call:Keltner Channels
KeltnerChannelMiddleIndicator
KeltnerChannelMiddleIndicator
KeltnerChannelMiddleIndicator(BarSeries series, int barCountEMA)— uses typical priceKeltnerChannelMiddleIndicator(Indicator<Num> indicator, int barCountEMA)— custom source
KeltnerChannelUpperIndicator and KeltnerChannelLowerIndicator
KeltnerChannelUpperIndicator and KeltnerChannelLowerIndicator
KeltnerChannelUpperIndicator(KeltnerChannelMiddleIndicator middle, double ratio, int barCountATR)Upper band = middle + ratio × ATR(barCountATR). The lower band mirrors this below the middle.Keltner / Bollinger squeeze detection
Keltner / Bollinger squeeze detection
Chandelier Exit
ChandelierExitLongIndicator
ChandelierExitLongIndicator
ChandelierExitLongIndicator(BarSeries series)— defaults: barCount 22, k 3.0ChandelierExitLongIndicator(BarSeries series, int barCount, double k)
highest(high, n) - k × ATR(n). A trailing stop for long positions that tightens as ATR contracts.ChandelierExitShortIndicator
ChandelierExitShortIndicator
ChandelierExitShortIndicator(BarSeries series)— defaults: barCount 22, k 3.0ChandelierExitShortIndicator(BarSeries series, int barCount, double k)
lowest(low, n) + k × ATR(n). Mirror of the long version for short positions.Ulcer Index, Chop
UlcerIndexIndicator
UlcerIndexIndicator
UlcerIndexIndicator(Indicator<Num> indicator, int barCount)Measures downside volatility by calculating the RMS of percentage drawdowns from the highest point in the window. Higher values = more painful drawdowns. Useful for risk-adjusted return metrics.ChopIndicator — Choppiness Index
ChopIndicator — Choppiness Index
ChopIndicator(BarSeries barSeries, int ciTimeFrame, int scaleTo)Identifies whether price is trending (scaleTo = 100, values below 38.2) or choppy (values above 61.8).SqueezeProIndicator
SqueezeProIndicator
SqueezeProIndicator
SqueezeProIndicator(BarSeries series, int barCount)Combines Bollinger Bands and Keltner Channels to detect squeeze conditions. Returns a value representing the momentum histogram when squeeze fires.Statistics indicators
StandardDeviationIndicator
StandardDeviationIndicator
StandardDeviationIndicator(Indicator<Num> indicator, int barCount)Rolling population standard deviation over barCount bars. The standard input for Bollinger Band deviations.VarianceIndicator
VarianceIndicator
n-1 divisor). Use factory methods to be explicit:VarianceIndicator(Indicator<Num> indicator, int barCount)— sample variance (default)VarianceIndicator(Indicator<Num> indicator, int barCount, SampleType sampleType)— explicit typeVarianceIndicator.ofSample(indicator, barCount)— sample variance (n-1)VarianceIndicator.ofPopulation(indicator, barCount)— population variance (n)
CorrelationCoefficientIndicator
CorrelationCoefficientIndicator
CorrelationCoefficientIndicator(Indicator<Num> indicator1, Indicator<Num> indicator2, int barCount)Pearson correlation between two indicators over a rolling window. Returns -1 to +1.Additional statistics indicators
Additional statistics indicators
| Class | Description |
|---|---|
ZScoreIndicator(indicator, barCount) | Rolling Z-score (standard deviations from mean) |
SimpleLinearRegressionIndicator(indicator, barCount, type) | Linear regression line, slope, or intercept |
SigmaIndicator(indicator, barCount) | Distance from mean in standard deviations |
CovarianceIndicator(indicator1, indicator2, barCount) | Rolling covariance |
PearsonCorrelationIndicator(indicator1, indicator2, barCount) | Pearson correlation |
MeanDeviationIndicator(indicator, barCount) | Mean absolute deviation |