Class BalanceOfPowerRTIndicator
- All Implemented Interfaces:
Resettable, CacheableRTIndicator, RichRTIndicator<MarketSnapshot>, RTIndicator
Measures the strength of buyers vs sellers:
BOP = (close - open) / (high - low)
Values range from -1 to +1. Positive = buying pressure, negative = selling pressure. Returns 0 when high equals low (no range).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this indicator's result is only meaningful over per-bar OHLCV data.This instance's math identity — equal signatures must mean identical value series for identical input.doubleupdate(double newValue) doubleupdateFrom(MarketSnapshot snap) Updates the indicator from a full market snapshot.doubleupdateOhlc(double open, double high, double low, double close) Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, reset, setValue, toString, toString, withDisplayHint, withMetaMethods inherited from interface Resettable
resetMethods inherited from interface RTIndicator
getDisplayHint, getId, getMeta, getValue, isHidden, isReady, ro, update, update
-
Constructor Details
-
BalanceOfPowerRTIndicator
public BalanceOfPowerRTIndicator()
-
-
Method Details
-
signature
Description copied from interface:CacheableRTIndicatorThis instance's math identity — equal signatures must mean identical value series for identical input.- Specified by:
signaturein interfaceCacheableRTIndicator- Returns:
- the identity, or
nullwhen this instance cannot state one (an unidentifiable source, a mode the implementation does not model) and must therefore compute live
-
requiresBarData
public boolean requiresBarData()Whether this indicator's result is only meaningful over per-bar OHLCV data.The distinction matters because a
RichRTIndicator<MarketSnapshot>accepts aTickerSnapshotjust as happily as aKlineSnapshot— and on the ticker pathvolume,high,lowandopenare the exchange's 24-hour rolling statistics, not this tick's bar. Nothing throws: OBV silently accumulates a 24h volume figure over and over, ATR reads a 24h range as if it were one bar's. The numbers look plausible and mean nothing, which is the worst failure mode of the three.Indicators that return
trueare flagged once per (indicator, instrument) when bound on the ticker path — seeInstrumentMapTickerSourceRTIndicator. Scalar indicators (SMA/EMA/RSI over a single price) are unaffected and default tofalse.true: this indicator reads per-bar OHLCV, which the ticker path does not carry.- Specified by:
requiresBarDatain interfaceRichRTIndicator<MarketSnapshot>- Returns:
trueif this indicator needs real bar data;falseby default
-
updateFrom
Description copied from interface:RichRTIndicatorUpdates the indicator from a full market snapshot. Returns the new value so callers can chain (matchingRTIndicator.update(double)'s contract).- Specified by:
updateFromin interfaceRichRTIndicator<MarketSnapshot>
-
updateOhlc
public double updateOhlc(double open, double high, double low, double close) -
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator
-