Class MinRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.core.AbstractIncrementalRTIndicator
com.wualabs.qtsurfer.engine.indicators.core.AbstractDecorableIncrementalRTIndicator
com.wualabs.qtsurfer.engine.indicators.helpers.MinRTIndicator
- All Implemented Interfaces:
ClockAware, Resettable, RTIndicator
Min value RT Indicator. With
periods == 0 tracks the all-time minimum; with
periods > 0 tracks the rolling minimum over the last periods inputs, evicting values
that scroll out of the window.-
Constructor Summary
ConstructorsConstructorDescriptionMinRTIndicator(int periods) MinRTIndicator(int periods, RTIndicator indicator) MinRTIndicator(RTIndicator indicator) -
Method Summary
Modifier and TypeMethodDescriptionprotected doublenextValue(double prevValue, double newValue) Non-windowed mode (periods == 0): all-time running minimum.voidreset()protected doubletickValue(int tick, boolean init, boolean endPeriod, double newValue) Windowed mode (periods > 0), called on every tick including the first:nextValuealone can't maintain the window because the framework routes the very first update throughAbstractIncrementalRTIndicator.initValue(double)instead, so the window is seeded here.Methods inherited from class AbstractDecorableIncrementalRTIndicator
getIndicator, setClockSupplier, updateMethods inherited from class AbstractIncrementalRTIndicator
getLastUpdateValue, getPeriodCycles, getPeriods, getPrevValue, initValue, isPeriodic, isReady, prevNextValue, setPeriodsMethods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
MinRTIndicator
public MinRTIndicator() -
MinRTIndicator
public MinRTIndicator(int periods) -
MinRTIndicator
-
MinRTIndicator
-
-
Method Details
-
reset
public void reset()- Specified by:
resetin interfaceResettable- Overrides:
resetin classAbstractDecorableIncrementalRTIndicator
-
tickValue
protected double tickValue(int tick, boolean init, boolean endPeriod, double newValue) Windowed mode (periods > 0), called on every tick including the first:nextValuealone can't maintain the window because the framework routes the very first update throughAbstractIncrementalRTIndicator.initValue(double)instead, so the window is seeded here.- Overrides:
tickValuein classAbstractIncrementalRTIndicator- Parameters:
tick- current tick index within the period (1-based)init- true only on the very first update of this indicatorendPeriod- true when this tick completes the current periodnewValue- the new input value- Returns:
- the computed value for this tick
-
nextValue
protected double nextValue(double prevValue, double newValue) Non-windowed mode (periods == 0): all-time running minimum.- Overrides:
nextValuein classAbstractDecorableIncrementalRTIndicator- Parameters:
prevValue- the previous indicator value (or last update value, depending on override)newValue- the new input value- Returns:
- the computed indicator value
-