Class RelativeVolatilityIndexRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.volatility.pro.RelativeVolatilityIndexRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
Relative Volatility Index (RVI) — RSI applied to standard deviation instead of price.
stddev = StdDev(close, stdPeriod) change = stddev - prevStddev upMove = max(change, 0) downMove = max(-change, 0) avgUp = WilderSmooth(upMove, rsiPeriod) avgDown = WilderSmooth(downMove, rsiPeriod) RVI = 100 * avgUp / (avgUp + avgDown)
Range: 0 to 100. Above 50 indicates increasing volatility, below 50 indicates decreasing volatility.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
RelativeVolatilityIndexRTIndicator
public RelativeVolatilityIndexRTIndicator() -
RelativeVolatilityIndexRTIndicator
public RelativeVolatilityIndexRTIndicator(int stdPeriod, int rsiPeriod)
-
-
Method Details
-
getStdPeriod
public int getStdPeriod() -
getRsiPeriod
public int getRsiPeriod() -
isReady
public boolean isReady()Description copied from interface:RTIndicatorReturns whether this indicator has received enough data to produce meaningful values.During the warmup period,
RTIndicator.getValue()may return 0 or a partial estimate that should not be used for trading decisions. Once this method returnstrue, the indicator's output is statistically valid.The default implementation returns
truefor backward compatibility. Indicators with warmup requirements should override this method.For composite indicators (e.g. Bollinger Bands, MACD), readiness is determined by the slowest internal component.
- Returns:
trueif the indicator has completed its warmup period
-
reset
public void reset()- Specified by:
resetin interfaceResettable- Overrides:
resetin classAbstractRTIndicator
-
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator
-