Skip to main content

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.

Volume indicators use trading volume to confirm or contradict price movements. Strong price moves accompanied by high volume are more reliable than moves on thin volume. These indicators help distinguish genuine breakouts from false signals.

VolumeIndicator

Constructors:
  • VolumeIndicator(BarSeries series) — raw volume per bar
  • VolumeIndicator(BarSeries series, int barCount) — sum of volume over barCount bars
A simple helper that exposes bar volume as an Indicator<Num> so it can compose with other indicators.
VolumeIndicator volume = new VolumeIndicator(series);
VolumeIndicator rollingVol = new VolumeIndicator(series, 20); // 20-bar sum

VWAP family

Constructors:
  • VWAPIndicator(BarSeries series, int barCount) — rolling VWAP over barCount bars using typical price
  • VWAPIndicator(Indicator<Num> priceIndicator, Indicator<Num> volumeIndicator, int barCount) — custom price/volume sources
Rolling VWAP: sum(typicalPrice × volume, n) / sum(volume, n). Unlike the traditional intraday VWAP (which resets daily), this rolls over any fixed window.
VWAPIndicator vwap = new VWAPIndicator(series, 14);

Num vwapValue = vwap.getValue(series.getEndIndex());
ClosePriceIndicator close = new ClosePriceIndicator(series);

// Price crossing above VWAP = potential entry
Rule entry = new CrossedUpIndicatorRule(close, vwap);
Constructor: AnchoredVWAPIndicator(BarSeries series, int anchorIndex)Cumulative VWAP starting from a specific bar index (e.g., start of session, earnings date, or swing low). The cumulative calculation resets at anchorIndex.
// Anchor VWAP from the start of the day (index 0)
AnchoredVWAPIndicator anchoredVwap = new AnchoredVWAPIndicator(series, 0);
Constructor: MVWAPIndicator(VWAPIndicator vwapIndicator, int barCount)Moving average of a VWAP indicator. Smooths the VWAP signal further.
VWAPIndicator vwap  = new VWAPIndicator(series, 14);
MVWAPIndicator mvwap = new MVWAPIndicator(vwap, 9);
Constructors:
  • VWAPDeviationIndicator(VWAPIndicator vwap, int barCount) — sum of squared price deviations from VWAP
  • VWAPStandardDeviationIndicator(VWAPIndicator vwap, int barCount) — standard deviation of price from VWAP
Used to construct VWAP bands:
VWAPIndicator vwap = new VWAPIndicator(series, 14);
VWAPStandardDeviationIndicator vwapSd = new VWAPStandardDeviationIndicator(vwap, 14);
Constructor: VWAPBandIndicator(VWAPIndicator vwap, VWAPStandardDeviationIndicator deviation, double multiplier, boolean isUpper)Computes upper or lower VWAP band: VWAP ± multiplier × VWAPStdDev.
VWAPIndicator vwap = new VWAPIndicator(series, 14);
VWAPStandardDeviationIndicator sd = new VWAPStandardDeviationIndicator(vwap, 14);

VWAPBandIndicator upperBand = new VWAPBandIndicator(vwap, sd, 2.0, true);
VWAPBandIndicator lowerBand = new VWAPBandIndicator(vwap, sd, 2.0, false);
Constructor: VWAPZScoreIndicator(VWAPIndicator vwap, int barCount)Z-score of close price relative to VWAP, using VWAPStandardDeviationIndicator. Identifies how many standard deviations the price sits away from VWAP.
VWAPIndicator vwap = new VWAPIndicator(series, 14);
VWAPZScoreIndicator zScore = new VWAPZScoreIndicator(vwap, 14);

On-Balance Volume and Accumulation/Distribution

Constructor: OnBalanceVolumeIndicator(BarSeries series)Cumulative total: adds bar volume when close is higher than previous close, subtracts when lower. Trend in OBV should confirm trend in price; divergence signals potential reversals.
OnBalanceVolumeIndicator obv = new OnBalanceVolumeIndicator(series);
EMAIndicator obvSignal = new EMAIndicator(obv, 9);

// OBV rising while price is flat = bullish accumulation
Constructor: AccumulationDistributionIndicator(BarSeries series)Cumulative sum of money flow volume (close location value × volume). Tracks smart-money buying/selling pressure. Divergence from price often precedes reversals.
AccumulationDistributionIndicator ad = new AccumulationDistributionIndicator(series);

Chaikin indicators

Constructor: ChaikinMoneyFlowIndicator(BarSeries series, int barCount)Rolling sum of Close Location Value × Volume, divided by rolling volume sum. Ranges from -1 to +1. Values above 0 indicate buying pressure; below 0 indicate selling pressure.
ChaikinMoneyFlowIndicator cmf = new ChaikinMoneyFlowIndicator(series, 20);

Num cmfValue = cmf.getValue(series.getEndIndex());
boolean buyingPressure = cmfValue.isGreaterThan(series.numFactory().zero());
Constructor: ChaikinOscillatorIndicator(BarSeries series, int shortBarCount, int longBarCount)MACD of the A/D Line: EMA(short, A/D) - EMA(long, A/D). Signals changes in accumulation/distribution momentum.
ChaikinOscillatorIndicator co = new ChaikinOscillatorIndicator(series, 3, 10);

Money Flow Index

Constructor: MoneyFlowIndexIndicator(BarSeries series, int barCount)Volume-weighted RSI using typical price. Ranges 0–100. Above 80 = overbought; below 20 = oversold. More reliable than RSI because high-volume moves are weighted more heavily.
MoneyFlowIndexIndicator mfi = new MoneyFlowIndexIndicator(series, 14);

Rule oversold   = new UnderIndicatorRule(mfi, 20);
Rule overbought = new OverIndicatorRule(mfi,  80);

Force Index, Ease of Movement

Constructor: ForceIndexIndicator(BarSeries series, int barCount)EMA(barCount, (close - prevClose) × volume). Combines price change and volume into a single value. Large positive force = strong buying; large negative = strong selling.
ForceIndexIndicator fi = new ForceIndexIndicator(series, 13);
Constructor: EaseOfMovementIndicator(BarSeries series, int barCount)Measures how easily price moves based on the relationship between price change and volume. High EOM = price rises easily on little volume.
EaseOfMovementIndicator eom = new EaseOfMovementIndicator(series, 14);

PVI and NVI

Constructors:
  • PVIIndicator(BarSeries series) — Positive Volume Index: adjusts only on days volume increases
  • NVIIndicator(BarSeries series) — Negative Volume Index: adjusts only on days volume decreases
PVI tracks what the crowd does (high volume days); NVI tracks what smart money does (low volume days). A rising NVI while PVI is flat suggests informed buying.
PVIIndicator pvi = new PVIIndicator(series);
NVIIndicator nvi = new NVIIndicator(series);

Additional volume indicators

Constructor: PVOIndicator(BarSeries series, int shortBarCount, int longBarCount, int signalBarCount)Volume analog of PPO: percentage difference between two volume EMAs. Identifies when volume is expanding or contracting relative to the recent average.
PVOIndicator pvo = new PVOIndicator(series, 12, 26, 9);
Constructor: MassIndexIndicator(BarSeries series, int emaBarCount, int barCount)Measures the narrowing and widening of the high–low range to detect reversals. A “reversal bulge” occurs when the mass index crosses above 27 then falls below 26.5.
MassIndexIndicator massIndex = new MassIndexIndicator(series, 9, 25);
Constructor: MarketFacilitationIndexIndicator(BarSeries series)Bill Williams’ MFI: (high - low) / volume. Measures price range per unit of volume. High MFI = the market is moving efficiently.
MarketFacilitationIndexIndicator mfi = new MarketFacilitationIndexIndicator(series);
Constructor: IIIIndicator(BarSeries series)((2 × close - high - low) / ((high - low) × volume)). Measures intraday buying/selling pressure.
IIIIndicator iii = new IIIIndicator(series);
Constructor: KlingerVolumeOscillatorIndicator(BarSeries series, int shortBarCount, int longBarCount)Oscillator designed to predict price reversals by comparing volume flow to long-term price trend.
KlingerVolumeOscillatorIndicator kvo = new KlingerVolumeOscillatorIndicator(series, 34, 55);
Constructor: RelativeVolumeStandardDeviationIndicator(BarSeries series, int barCount)Z-score of current volume relative to its rolling mean and standard deviation. Values above 2 indicate unusually high volume.
RelativeVolumeStandardDeviationIndicator rvsd = new RelativeVolumeStandardDeviationIndicator(series, 20);
Constructor: ROCVIndicator(BarSeries series, int barCount)Percentage change in volume over barCount bars. Helps confirm whether volume is expanding or contracting.
ROCVIndicator rocv = new ROCVIndicator(series, 14);
Constructor: TimeSegmentedVolumeIndicator(BarSeries series, int barCount)Divides volume into buying and selling segments based on close relative to prior close, summed over a rolling window.
TimeSegmentedVolumeIndicator tsv = new TimeSegmentedVolumeIndicator(series, 13);