Class BollingerPercentBRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
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 Summary
Constructors -
Method Summary
Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
BollingerPercentBRTIndicator
-
-
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.
An indicator derived from other indicators (a distance between two of them, a function of one, a view of a parent's band) is ready when all the indicators it reads are ready, plus its own warm-up if it has one. It must not report ready from the first point while its sources are still warming up, and resetting it returns the indicators it updates to their start.
- Returns:
trueif the indicator has completed its warmup period
-
reset
public void reset()- Specified by:
resetin interfaceResettable- Overrides:
resetin classAbstractRTIndicator
-
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator
-