Class BollingerBandWidthRTIndicator

All Implemented Interfaces:
Resettable, RTIndicator

public class BollingerBandWidthRTIndicator extends AbstractDecorableRTIndicator
Bollinger BandWidth RT Indicator.
See Also:
  • Field Details

    • ID

      public static final String ID
      Canonical catalog id, set as an explicit IndicatorMeta.ID override where getId() class-name derivation would be wrong.
      See Also:
  • Constructor Details

    • BollingerBandWidthRTIndicator

      public BollingerBandWidthRTIndicator(@NonNull @NonNull BollingerBandsRTIndicator bollingerBandsRTIndicator)
  • Method Details

    • isReady

      public boolean isReady()
      Description copied from interface: RTIndicator
      Returns 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 returns true, the indicator's output is statistically valid.

      The default implementation returns true for 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:
      true if the indicator has completed its warmup period
    • getValue

      public double getValue()
      Computes the Bollinger BandWidth as a percentage: 100 * (upper - lower) / middle. This is a derived/lazy indicator that recalculates from the Bollinger Bands state on every read rather than maintaining its own state.
      Specified by:
      getValue in interface RTIndicator
      Overrides:
      getValue in class AbstractRTIndicator
      Returns:
      the bandwidth as a percentage of the middle band
    • update

      public double update(double newValue)
      Specified by:
      update in interface RTIndicator
      Overrides:
      update in class AbstractRTIndicator