Ejemplo n.º 1
0
 /// <summary>
 /// Resets this indicator to its initial state
 /// </summary>
 public override void Reset()
 {
     base.Reset();
     ShortAverage.Reset();
     MediumAverage.Reset();
     LongAverage.Reset();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Copmutes the next value for this indicator from the given state.
        /// </summary>
        /// <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(IndicatorDataPoint input)
        {
            ShortAverage.Update(input);
            MediumAverage.Update(input);
            LongAverage.Update(input);

            return(LongAverage.Current.Value - MediumAverage.Current.Value + ShortAverage.Current.Value);
        }