Class VwapRTIndicator
- All Implemented Interfaces:
Resettable, CacheableRTIndicator, RichRTIndicator<MarketSnapshot>, RTIndicator
Cumulative VWAP using the typical price:
typicalPrice = (high + low + close) / 3 VWAP = sum(typicalPrice * volume) / sum(volume)
Call reset() at the start of each session/period to reset the cumulative sums.
-
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) doubleupdateFrom(MarketSnapshot snap) Updates the indicator from a full market snapshot.doubleupdateHLCV(double high, double low, double close, double volume) 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
-
VwapRTIndicator
public VwapRTIndicator()
-
-
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>
-
updateHLCV
public double updateHLCV(double high, double low, double close, double volume) -
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator
-