/// <summary> /// Computes the next value for this indicator from the given state. /// </summary> /// <param name="window">The window of data held in this indicator</param> /// <param name="input">The input value to this indicator on this time step</param> /// <returns>A new value for this indicator</returns> protected override decimal ComputeNextValue(IReadOnlyWindow <IndicatorDataPoint> window, IndicatorDataPoint input) { RollingSum.Update(input.Time, input.Value); return(RollingSum.Current.Value / window.Count); }
/// <summary> /// Resets this indicator to its initial state /// </summary> public override void Reset() { RollingSum.Reset(); base.Reset(); }