Class PercentVolatilityRTIndicator

All Implemented Interfaces:
Resettable, RTIndicator

public class PercentVolatilityRTIndicator extends VolatilityRTIndicator
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 Details

    • PercentVolatilityRTIndicator

      public PercentVolatilityRTIndicator()
    • PercentVolatilityRTIndicator

      public PercentVolatilityRTIndicator(RTIndicator averageIndicator)
  • Method Details

    • amplify

      public PercentVolatilityRTIndicator amplify(double amplify)
    • nextValue

      protected double nextValue(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. 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:
      nextValue in class VolatilityRTIndicator
      Parameters:
      averageIndicator - the averaging indicator for smoothing
      prevValue - the previous input value
      newValue - the current input value
      Returns:
      the smoothed percent volatility, amplified