/// <summary> /// Computes the Slow Stochastic %K. /// </summary> /// <param name="period">The period.</param> /// <param name="constantK">The constant k.</param> /// <param name="input">The input.</param> /// <returns>The Slow Stochastics %K value.</returns> private decimal ComputeStochK(int period, int constantK, TradeBar input) { var stochK = Maximum.Samples >= (period + constantK - 1) ? SumFastK / constantK : new decimal(0.0); SumSlowK.Update(input.Time, stochK); return(stochK * 100); }
/// <summary> /// Resets this indicator to its initial state /// </summary> public override void Reset() { FastStoch.Reset(); StochK.Reset(); StochD.Reset(); SumFastK.Reset(); SumSlowK.Reset(); base.Reset(); }