Class Indicators
java.lang.Object
com.quantfinlib.indicators.Indicators
Technical Indicator Engine: production-ready implementations of the standard
technical analysis toolkit. All indicators operate on primitive arrays and
return primitive arrays (or small records of arrays) aligned with the input:
index i of the output corresponds to bar i, with
NaN for warm-up bars.
Included: RSI, SMA, EMA, WMA, VWAP, MACD, ATR, ADX, CCI, ROC, Momentum, OBV, CMF, SuperTrend, Ichimoku Cloud, Stochastic RSI, Williams %R, Parabolic SAR, Bollinger Bands, Keltner Channel, Donchian Channel.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recorddirection: +1 = uptrend (value is support), -1 = downtrend (value is resistance). -
Method Summary
Modifier and TypeMethodDescriptionstatic Indicators.AdxAverage Directional Index with +DI / -DI (Wilder).static double[]Average True Range (Wilder smoothing).static Indicators.Bollingerbollinger(double[] close, int period, double k) Bollinger Bands: SMA middle band with k population standard deviations.static double[]Commodity Channel Index over typical price.static double[]Chaikin Money Flow.static Indicators.DonchianDonchian Channel: highest high / lowest low over the period.static double[]ema(double[] v, int period) Exponential moving average, seeded with the SMA of the firstperiodvalues.static double[]highest(double[] v, int period) static Indicators.IchimokuIchimoku Cloud with standard forward/backward displacement: senkou spans are plottedkijunPeriodbars ahead, chikoukijunPeriodbars behind.static Indicators.KeltnerKeltner Channel: EMA middle band with ATR-based envelope.static double[]lowest(double[] v, int period) static Indicators.Macdmacd(double[] close, int fastPeriod, int slowPeriod, int signalPeriod) MACD: EMA(fast) - EMA(slow), with an EMA signal line and histogram.static double[]momentum(double[] v, int period) Momentum: v[i] - v[i-period].static double[]On-Balance Volume.static double[]parabolicSar(BarSeries s, double afStart, double afStep, double afMax) Parabolic SAR (standard Wilder acceleration schedule).static double[]roc(double[] v, int period) Rate of change, percent: (v[i] / v[i-period] - 1) * 100.static double[]rollingStd(double[] v, int period) Rolling population standard deviation.static double[]rsi(double[] v, int period) Relative Strength Index (Wilder smoothing).static double[]sma(double[] v, int period) Simple moving average.static Indicators.StochRsistochasticRsi(double[] close, int rsiPeriod, int stochPeriod, int kSmooth, int dSmooth) Stochastic RSI: stochastic oscillator applied to RSI, with %K and %D smoothing.static Indicators.SuperTrendsuperTrend(BarSeries s, int period, double multiplier) SuperTrend with ATR bands.static double[]True range series.static double[]Cumulative Volume-Weighted Average Price (anchored at the series start).static double[]Williams %R: -100 * (highestHigh - close) / (highestHigh - lowestLow).static double[]wma(double[] v, int period) Linearly weighted moving average.
-
Method Details
-
sma
public static double[] sma(double[] v, int period) Simple moving average. -
ema
public static double[] ema(double[] v, int period) Exponential moving average, seeded with the SMA of the firstperiodvalues. -
wma
public static double[] wma(double[] v, int period) Linearly weighted moving average. -
rsi
public static double[] rsi(double[] v, int period) Relative Strength Index (Wilder smoothing). -
roc
public static double[] roc(double[] v, int period) Rate of change, percent: (v[i] / v[i-period] - 1) * 100. -
momentum
public static double[] momentum(double[] v, int period) Momentum: v[i] - v[i-period]. -
macd
public static Indicators.Macd macd(double[] close, int fastPeriod, int slowPeriod, int signalPeriod) MACD: EMA(fast) - EMA(slow), with an EMA signal line and histogram. -
stochasticRsi
public static Indicators.StochRsi stochasticRsi(double[] close, int rsiPeriod, int stochPeriod, int kSmooth, int dSmooth) Stochastic RSI: stochastic oscillator applied to RSI, with %K and %D smoothing. -
williamsR
Williams %R: -100 * (highestHigh - close) / (highestHigh - lowestLow). -
cci
Commodity Channel Index over typical price. -
trueRange
True range series. -
atr
Average True Range (Wilder smoothing). -
adx
Average Directional Index with +DI / -DI (Wilder). -
bollinger
Bollinger Bands: SMA middle band with k population standard deviations. -
keltner
public static Indicators.Keltner keltner(BarSeries s, int emaPeriod, int atrPeriod, double multiplier) Keltner Channel: EMA middle band with ATR-based envelope. -
donchian
Donchian Channel: highest high / lowest low over the period. -
obv
On-Balance Volume. -
vwap
Cumulative Volume-Weighted Average Price (anchored at the series start). -
cmf
Chaikin Money Flow. -
superTrend
SuperTrend with ATR bands. -
ichimoku
public static Indicators.Ichimoku ichimoku(BarSeries s, int tenkanPeriod, int kijunPeriod, int senkouBPeriod) Ichimoku Cloud with standard forward/backward displacement: senkou spans are plottedkijunPeriodbars ahead, chikoukijunPeriodbars behind. -
parabolicSar
Parabolic SAR (standard Wilder acceleration schedule). -
highest
public static double[] highest(double[] v, int period) -
lowest
public static double[] lowest(double[] v, int period) -
rollingStd
public static double[] rollingStd(double[] v, int period) Rolling population standard deviation.
-