Class BollingerPercentBRTIndicator

java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.bollinger.BollingerPercentBRTIndicator
All Implemented Interfaces:
Resettable, RTIndicator

public class BollingerPercentBRTIndicator extends AbstractRTIndicator
Bollinger %B indicator with O(1) per-tick computation.

Measures where the current price sits relative to the Bollinger Bands:

  %B = (price - lowerBand) / (upperBand - lowerBand)

Values: 0 = at lower band, 0.5 = at middle, 1 = at upper band. Values above 1 or below 0 indicate price outside the bands.

Decorator pattern: wraps an existing BollingerBandsRTIndicator.

  • Constructor Details

  • 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
    • reset

      public void reset()
      Specified by:
      reset in interface Resettable
      Overrides:
      reset in class AbstractRTIndicator
    • update

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