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
Modifier and TypeMethodDescriptiondoublegetValue()Computes the Bollinger BandWidth as a percentage: 100 * (upper - lower) / middle.booleanisReady()Ready when the wrapped indicator is: this wrapper has no warm-up of its own.voidreset()This indicator is a view of the bands, which it never updates and so does not own: resetting it only clears its own value, and the bands go back to their start when their owner resets them.doubleupdate(double newValue) Methods inherited from class AbstractDecorableRTIndicator
getIndicator, getIndicatorValueMethods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, hashCode, hide, isPoison, 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 class:AbstractDecorableRTIndicatorReady when the wrapped indicator is: this wrapper has no warm-up of its own.- Specified by:
isReadyin interfaceRTIndicator- Overrides:
isReadyin classAbstractDecorableRTIndicator- Returns:
trueif the indicator has completed its warmup period
-
reset
public void reset()This indicator is a view of the bands, which it never updates and so does not own: resetting it only clears its own value, and the bands go back to their start when their owner resets them.- Specified by:
resetin interfaceResettable- Overrides:
resetin classAbstractDecorableRTIndicator
-
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
-