Skip to main content
Momentum indicators quantify the speed of price movement. They are most useful for spotting overbought/oversold conditions, detecting divergences between price and momentum, and timing entries during pullbacks in established trends.

RSI

Constructor: RSIIndicator(Indicator<Num> indicator, int barCount)Classic Welles Wilder RSI using his smoothed moving average (MMA). Returns a value between 0 and 100. Readings above 70 are typically overbought; below 30 are oversold.
ClosePriceIndicator close = new ClosePriceIndicator(series);
RSIIndicator rsi = new RSIIndicator(close, 14);

int idx = series.getEndIndex();
Num rsiValue = rsi.getValue(idx);

// Overbought / oversold rules
Rule oversold   = new UnderIndicatorRule(rsi, 30);
Rule overbought = new OverIndicatorRule(rsi,  70);
Unstable bars: barCount + close.getCountOfUnstableBars()
Constructor: StochasticRSIIndicator(Indicator<Num> indicator, int barCount)Applies the Stochastic formula to RSI values. Oscillates between 0 and 1, making it more sensitive than plain RSI for spotting short-term reversals.
ClosePriceIndicator close = new ClosePriceIndicator(series);
StochasticRSIIndicator stochRsi = new StochasticRSIIndicator(close, 14);
Constructor: ConnorsRSIIndicator(Indicator<Num> indicator, int rsiBarCount, int streakRsiBarCount, int rankBarCount)Composite of three components: RSI of price, RSI of consecutive up/down streak length, and percentile rank of the current move. Designed for short-term mean reversion.
ClosePriceIndicator close = new ClosePriceIndicator(series);
ConnorsRSIIndicator crsi = new ConnorsRSIIndicator(close, 3, 2, 100);

Stochastic

Constructors:
  • StochasticOscillatorKIndicator(BarSeries barSeries, int barCount) — uses close, high, low
  • StochasticOscillatorKIndicator(Indicator<Num> indicator, int barCount, Indicator<Num> highPriceIndicator, Indicator<Num> lowPriceIndicator)
Measures where the close sits within the high–low range over barCount bars. Returns 0–100.
StochasticOscillatorKIndicator stochK = new StochasticOscillatorKIndicator(series, 14);
Constructors:
  • StochasticOscillatorDIndicator(StochasticOscillatorKIndicator k) — 3-period SMA of %K
  • StochasticOscillatorDIndicator(Indicator<Num> indicator) — custom smoothed source
%D is the signal line of the stochastic oscillator. Crossovers of %K and %D are common entry triggers.
StochasticOscillatorKIndicator k = new StochasticOscillatorKIndicator(series, 14);
StochasticOscillatorDIndicator d = new StochasticOscillatorDIndicator(k);

Rule entryRule = new CrossedUpIndicatorRule(k, d)
    .and(new UnderIndicatorRule(k, 20));
Constructor: StochasticIndicator(BarSeries series, int barCount)Unified stochastic implementation; use StochasticOscillatorKIndicator / StochasticOscillatorDIndicator for full control.

CCI, CMO, ROC

Constructor: CCIIndicator(BarSeries series, int barCount)Measures how far the typical price has deviated from its SMA, normalized by mean deviation times 0.015. Values above +100 indicate overbought; below -100 indicate oversold.
CCIIndicator cci = new CCIIndicator(series, 20);

Rule overbought = new OverIndicatorRule(cci,  100);
Rule oversold   = new UnderIndicatorRule(cci, -100);
Constructor: CMOIndicator(Indicator<Num> indicator, int barCount)Sum of up-moves minus sum of down-moves, divided by total movement, scaled to -100…+100. Similar to RSI but uses raw differences instead of smoothed averages.
ClosePriceIndicator close = new ClosePriceIndicator(series);
CMOIndicator cmo = new CMOIndicator(close, 14);
Constructor: ROCIndicator(Indicator<Num> indicator, int barCount)Percentage change: ((current - previous(n)) / previous(n)) * 100. Pure momentum without smoothing.
ClosePriceIndicator close = new ClosePriceIndicator(series);
ROCIndicator roc = new ROCIndicator(close, 12);

// Positive ROC = price higher than 12 bars ago
Rule momentum = new OverIndicatorRule(roc, series.numFactory().zero());

Williams %R, PPO, DPO

Constructors:
  • WilliamsRIndicator(BarSeries barSeries, int barCount)
  • WilliamsRIndicator(ClosePriceIndicator closePriceIndicator, int barCount, HighPriceIndicator highPriceIndicator, LowPriceIndicator lowPriceIndicator)
Inverted stochastic. Range: -100 to 0. Readings above -20 are overbought; below -80 are oversold.
WilliamsRIndicator williamsR = new WilliamsRIndicator(series, 14);

Rule overbought = new OverIndicatorRule(williamsR,  -20);
Rule oversold   = new UnderIndicatorRule(williamsR, -80);
Constructor: PPOIndicator(Indicator<Num> indicator, int shortBarCount, int longBarCount)Percentage difference between two EMAs: (EMA(short) - EMA(long)) / EMA(long) * 100. Normalizes MACD for cross-asset comparison.
ClosePriceIndicator close = new ClosePriceIndicator(series);
PPOIndicator ppo = new PPOIndicator(close, 12, 26);
Constructor: DPOIndicator(Indicator<Num> indicator, int barCount)Removes the trend component by comparing the close to a past SMA value. Highlights price cycles.
ClosePriceIndicator close = new ClosePriceIndicator(series);
DPOIndicator dpo = new DPOIndicator(close, 20);

KST, TSI, STC

Constructor: KSTIndicator(Indicator<Num> indicator, int rcma1, int rcma2, int rcma3, int rcma4, int sma1, int sma2, int sma3, int sma4)Weighted sum of four smoothed ROC values. Provides a broad view of price momentum across multiple time frames.
ClosePriceIndicator close = new ClosePriceIndicator(series);
KSTIndicator kst = new KSTIndicator(close, 10, 13, 14, 15, 10, 13, 14, 15);
Constructor: TrueStrengthIndexIndicator(Indicator<Num> indicator, int shortBarCount, int longBarCount)Double-smoothed momentum oscillator. Ranges from -100 to +100. Useful for identifying divergence and overbought/oversold extremes.
ClosePriceIndicator close = new ClosePriceIndicator(series);
TrueStrengthIndexIndicator tsi = new TrueStrengthIndexIndicator(close, 13, 25);
Constructor: SchaffTrendCycleIndicator(Indicator<Num> indicator, int cycleBarCount, int shortBarCount, int longBarCount)Combines MACD and a cycle component to speed up signal generation. Oscillates between 0 and 100.
ClosePriceIndicator close = new ClosePriceIndicator(series);
SchaffTrendCycleIndicator stc = new SchaffTrendCycleIndicator(close, 10, 23, 50);

Ultimate Oscillator, Vortex

Constructor: UltimateOscillatorIndicator(Indicator<Num> indicator, int shortBarCount, int middleBarCount, int longBarCount)Weighted average of three oscillators with different time periods (typically 7, 14, 28). Reduces false signals common in single-period oscillators.
ClosePriceIndicator close = new ClosePriceIndicator(series);
UltimateOscillatorIndicator uo = new UltimateOscillatorIndicator(close, 7, 14, 28);
Constructors:
  • VortexIndicator(BarSeries series) — default period 14
  • VortexIndicator(BarSeries series, int barCount)
Measures two vortex movements: positive (+VI) and negative (-VI). The oscillator value is +VI - -VI. Access the individual lines via getPositiveValue(int) and getNegativeValue(int).
VortexIndicator vortex = new VortexIndicator(series, 14);

int idx = series.getEndIndex();
Num plusVI  = vortex.getPositiveValue(idx);
Num minusVI = vortex.getNegativeValue(idx);
Num osc     = vortex.getValue(idx);        // +VI - -VI

// +VI crosses above -VI = bullish signal
Rule entry = new CrossedUpIndicatorRule(
    indicator -> vortex.getPositiveValue(indicator),
    indicator -> vortex.getNegativeValue(indicator)
);

Net Momentum

Factory methods (preferred):
  • NetMomentumIndicator.forRsi(Indicator<Num> rsi, int window) — decay = 1 (running total)
  • NetMomentumIndicator.forRsiWithDecay(Indicator<Num> rsi, int window, double decay) — exponential fade
Accumulates signed RSI deltas over a window. decay = 1 reproduces the original running-sum behavior; values below 1 apply exponential fade so older deltas contribute less.
ClosePriceIndicator close = new ClosePriceIndicator(series);
RSIIndicator rsi = new RSIIndicator(close, 14);

NetMomentumIndicator nm = NetMomentumIndicator.forRsi(rsi, 20);
NetMomentumIndicator nmDecay = NetMomentumIndicator.forRsiWithDecay(rsi, 20, 0.9);

Other momentum indicators

Constructor: AccelerationDecelerationIndicator(BarSeries series, int shortBarCount, int longBarCount)Bill Williams’ AC indicator: difference between the Awesome Oscillator and its 5-period SMA.
AccelerationDecelerationIndicator ac = new AccelerationDecelerationIndicator(series, 5, 34);
Constructor: AwesomeOscillatorIndicator(Indicator<Num> indicator, int shortBarCount, int longBarCount)Midpoint-price difference between a short and long SMA (default 5 and 34). Measures market momentum.
MedianPriceIndicator median = new MedianPriceIndicator(series);
AwesomeOscillatorIndicator ao = new AwesomeOscillatorIndicator(median, 5, 34);
Constructor: CoppockCurveIndicator(Indicator<Num> indicator, int wmaBarCount, int longRoCBarCount, int shortRoCBarCount)Long-term momentum indicator originally designed for monthly data. Sum of two ROC values smoothed with WMA.
ClosePriceIndicator close = new ClosePriceIndicator(series);
CoppockCurveIndicator coppock = new CoppockCurveIndicator(close, 10, 14, 11);
Constructor: FisherIndicator(Indicator<Num> indicator, int barCount)Converts prices into a Gaussian normal distribution. Sharp spikes indicate potential turning points.
ClosePriceIndicator close = new ClosePriceIndicator(series);
FisherIndicator fisher = new FisherIndicator(close, 10);
Constructor: IntraDayMomentumIndexIndicator(BarSeries series, int barCount)Intraday version of RSI using open-to-close movements instead of close-to-close.
IntraDayMomentumIndexIndicator imi = new IntraDayMomentumIndexIndicator(series, 14);
Constructor: KRIIndicator(Indicator<Num> indicator, int barCount)Percentage distance of price from its SMA. A simple mean-reversion gauge.
ClosePriceIndicator close = new ClosePriceIndicator(series);
KRIIndicator kri = new KRIIndicator(close, 14);