Class BollingerBandWidthRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.core.AbstractDecorableRTIndicator
com.wualabs.qtsurfer.engine.indicators.bollinger.BollingerBandWidthRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
Bollinger BandWidth RT Indicator.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBollingerBandWidthRTIndicator(@NonNull BollingerBandsRTIndicator bollingerBandsRTIndicator) -
Method Summary
Methods inherited from class AbstractDecorableRTIndicator
getIndicator, getIndicatorValueMethods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, hashCode, hide, isPoison, reset, setValue, toString, toString, withDisplayHint, withMeta
-
Field Details
-
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: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
-
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:
getValuein interfaceRTIndicator- Overrides:
getValuein classAbstractRTIndicator- Returns:
- the bandwidth as a percentage of the middle band
-
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator
-