Class BiFunctionRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.numeric.BiFunctionRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
Allow to apply a function to update from 2 RTIndicators
-
Constructor Summary
ConstructorsConstructorDescriptionBiFunctionRTIndicator(@NonNull RTIndicator indicatorA, @NonNull RTIndicator indicatorB, @NonNull BiFunction<Double, Double, Double> bifunction) -
Method Summary
Modifier and TypeMethodDescriptionstatic BiFunctionRTIndicatoradd(@NonNull RTIndicator indicatorA, @NonNull RTIndicator indicatorB) static BiFunctionRTIndicatordiff(@NonNull RTIndicator indicatorA, @NonNull RTIndicator indicatorB) static BiFunctionRTIndicatordiv(@NonNull RTIndicator indicatorA, @NonNull RTIndicator indicatorB) static BiFunctionRTIndicatormax(@NonNull RTIndicator indicatorA, @NonNull RTIndicator indicatorB) static BiFunctionRTIndicatormin(@NonNull RTIndicator indicatorA, @NonNull RTIndicator indicatorB) static BiFunctionRTIndicatormul(@NonNull RTIndicator indicatorA, @NonNull RTIndicator indicatorB) doubleupdate(double newValue) Updates both source indicators with the same input value and applies the bi-function to their results.Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, reset, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
BiFunctionRTIndicator
public BiFunctionRTIndicator(@NonNull @NonNull RTIndicator indicatorA, @NonNull @NonNull RTIndicator indicatorB, @NonNull @NonNull BiFunction<Double, Double, Double> bifunction)
-
-
Method Details
-
update
public double update(double newValue) Updates both source indicators with the same input value and applies the bi-function to their results. Both indicators receive the same raw input, enabling operations like diff(indicatorA, indicatorB).- Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator- Parameters:
newValue- the input value forwarded to both indicators- Returns:
- the result of applying the bi-function to both indicator outputs
-
max
public static BiFunctionRTIndicator max(@NonNull @NonNull RTIndicator indicatorA, @NonNull @NonNull RTIndicator indicatorB) -
min
public static BiFunctionRTIndicator min(@NonNull @NonNull RTIndicator indicatorA, @NonNull @NonNull RTIndicator indicatorB) -
add
public static BiFunctionRTIndicator add(@NonNull @NonNull RTIndicator indicatorA, @NonNull @NonNull RTIndicator indicatorB) -
diff
public static BiFunctionRTIndicator diff(@NonNull @NonNull RTIndicator indicatorA, @NonNull @NonNull RTIndicator indicatorB) -
mul
public static BiFunctionRTIndicator mul(@NonNull @NonNull RTIndicator indicatorA, @NonNull @NonNull RTIndicator indicatorB) -
div
public static BiFunctionRTIndicator div(@NonNull @NonNull RTIndicator indicatorA, @NonNull @NonNull RTIndicator indicatorB)
-