Class KurtosisRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.core.AbstractWindowSeriesRTIndicator
com.wualabs.qtsurfer.engine.indicators.statistics.pro.KurtosisRTIndicator
- All Implemented Interfaces:
Resettable, RTIndicator
Rolling Excess Kurtosis with O(1) per-tick updates.
Measures the "tailedness" of the distribution of values in the rolling window. A normal distribution has excess kurtosis of 0; positive (leptokurtic) indicates heavy tails; negative (platykurtic) indicates light tails. Critical for risk management — heavy tails mean more extreme events.
Uses the sample excess kurtosis formula:
K = [n(n+1) / ((n-1)(n-2)(n-3))] * Σ((x_i - x̄)/s)⁴ - 3(n-1)² / ((n-2)(n-3))computed from four power-sum accumulators (
sum, sumSq,
sumCub, sumQuad).
Returns 0 when n < 4 or when standard deviation is zero.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractWindowSeriesRTIndicator
getPeriods, isReady, reset, window, windowSizeMethods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
KurtosisRTIndicator
public KurtosisRTIndicator(int periods)
-
-
Method Details
-
onEvict
protected void onEvict(double evicted) Description copied from class:AbstractWindowSeriesRTIndicatorCalled when the window evicts the oldest value. Override to update accumulators.- Overrides:
onEvictin classAbstractWindowSeriesRTIndicator
-
onReset
protected void onReset()Description copied from class:AbstractWindowSeriesRTIndicatorCalled after window is cleared. Override to zero accumulators.- Overrides:
onResetin classAbstractWindowSeriesRTIndicator
-
getMean
public double getMean()Returns the current rolling mean. -
update
public double update(double newValue) - Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator
-