Class BollingerBandsRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.bollinger.BollingerBandsRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
Bollinger bands RTIndicator
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBollingerBandsRTIndicator(int periods, Number k) BollingerBandsRTIndicator(RTIndicator indicator, int periods, Number k) -
Method Summary
Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, 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
-
BollingerBandsRTIndicator
public BollingerBandsRTIndicator() -
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
-
reset
public void reset()- Specified by:
resetin interfaceResettable- Overrides:
resetin classAbstractRTIndicator
-
withAverageSample
-
getStdDev
-
getUpper
-
getLower
-
getBandWidth
-
update
public double update(double newValue) Computes the Bollinger Bands for a new value. The middle band is the SMA (retrieved from the variance's internal SMA). Upper and lower bands are computed as middle +/- (k * standard deviation). All three bands are updated atomically on each call.- Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator- Parameters:
newValue- the new input price- Returns:
- the middle band value (SMA)
-