Class ObvRTIndicator
- All Implemented Interfaces:
Resettable, CacheableRTIndicator, RichRTIndicator<MarketSnapshot>, RTIndicator
Cumulative volume indicator that adds volume on up-closes and subtracts on down-closes:
if close > prevClose: OBV += volume if close < prevClose: OBV -= volume if close == prevClose: OBV unchanged
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this indicator's result is only meaningful over per-bar OHLCV data.voidreset()This instance's math identity — equal signatures must mean identical value series for identical input.doubleupdate(double newValue) doubleupdateCV(double close, double volume) doubleupdateFrom(MarketSnapshot snap) Updates the indicator from a full market snapshot.Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMetaMethods inherited from interface RTIndicator
getDisplayHint, getId, getMeta, getValue, isHidden, isReady, ro, update, update
-
Constructor Details
-
ObvRTIndicator
public ObvRTIndicator()
-
-
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
-
reset
public void reset()- Specified by:
resetin interfaceResettable- Overrides:
resetin classAbstractRTIndicator
-
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>
-
updateCV
public double updateCV(double close, double volume) -
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator
-