Class DistanceRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.distance.DistanceRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
Distance from 2 indicators
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDistanceRTIndicator(@NonNull RTIndicator indicator, @NonNull RTIndicator baseIndicator) -
Method Summary
Modifier and TypeMethodDescriptiondoubleupdate(double newValue) Computes the fractional distance between two indicators: (indicator - base) / base.Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, reset, setValue, toString, toString, withDisplayHint, withMeta
-
Field Details
-
ID
Canonical catalog id, set as an explicit IndicatorMeta.ID override where getId() class-name derivation would be wrong.- See Also:
-
-
Constructor Details
-
DistanceRTIndicator
public DistanceRTIndicator(@NonNull @NonNull RTIndicator indicator, @NonNull @NonNull RTIndicator baseIndicator)
-
-
Method Details
-
update
public double update(double newValue) Computes the fractional distance between two indicators: (indicator - base) / base. Both indicators receive the same input value. Returns 0 when the base is zero to avoid division by zero.- Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator- Parameters:
newValue- the input value forwarded to both indicators- Returns:
- the fractional distance between the two indicator values
-