Class McGinleyDynamicRTIndicator

java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.averages.pro.McGinleyDynamicRTIndicator
All Implemented Interfaces:
Resettable, RTIndicator

public class McGinleyDynamicRTIndicator extends AbstractRTIndicator
McGinley Dynamic with O(1) per-tick computation.

Self-adjusting moving average that adapts to market speed:

  MD = MD_prev + (close - MD_prev) / (N * (close / MD_prev)^4)

Accelerates in trending markets (close far from MD) and decelerates in ranging markets (close near MD). Reduces whipsaws compared to EMA/SMA.

  • Constructor Details

    • McGinleyDynamicRTIndicator

      public McGinleyDynamicRTIndicator()
    • McGinleyDynamicRTIndicator

      public McGinleyDynamicRTIndicator(int periods)
  • Method Details

    • getPeriods

      public int getPeriods()
    • isReady

      public boolean isReady()
      Description copied from interface: RTIndicator
      Returns whether this indicator has received enough data to produce meaningful values.

      During the warmup period, RTIndicator.getValue() may return 0 or a partial estimate that should not be used for trading decisions. Once this method returns true, the indicator's output is statistically valid.

      The default implementation returns true for backward compatibility. Indicators with warmup requirements should override this method.

      For composite indicators (e.g. Bollinger Bands, MACD), readiness is determined by the slowest internal component.

      Returns:
      true if the indicator has completed its warmup period
    • reset

      public void reset()
      Specified by:
      reset in interface Resettable
      Overrides:
      reset in class AbstractRTIndicator
    • update

      public double update(double newValue)
      Specified by:
      update in interface RTIndicator
      Overrides:
      update in class AbstractRTIndicator