Class PercentVolatilityRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.helpers.VolatilityRTIndicator
com.wualabs.qtsurfer.engine.indicators.helpers.PercentVolatilityRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
Volatility indicator that measures percent price changes between updates,
averaged via a smoothing indicator. An optional amplification factor scales
the output for increased sensitivity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionamplify(double amplify) protected doublenextValue(RTIndicator averageIndicator, double prevValue, double newValue) Computes the absolute percent change between consecutive values, applies the amplification factor, and feeds the result into the averaging indicator.Methods inherited from class VolatilityRTIndicator
clampUpdates, getValue, updateMethods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, hashCode, hide, isPoison, reset, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
PercentVolatilityRTIndicator
public PercentVolatilityRTIndicator() -
PercentVolatilityRTIndicator
-
-
Method Details
-
amplify
-
nextValue
Computes the absolute percent change between consecutive values, applies the amplification factor, and feeds the result into the averaging indicator. Returns 0 when the previous value is zero to avoid division by zero.The per-tick change is fed to the smoother at full precision: rounding it first (historically to two significant digits) baked a fresh quantization error into every SMA/EMA update, compounding across the whole series.
- Overrides:
nextValuein classVolatilityRTIndicator- Parameters:
averageIndicator- the averaging indicator for smoothingprevValue- the previous input valuenewValue- the current input value- Returns:
- the smoothed percent volatility, amplified
-