예제 #1
0
        /// <summary>
        ///      Computes the next value of this indicator from the given state
        /// </summary>
        /// <param name="time"></param>
        /// <param name="input">The input given to the indicator</param>
        protected override DoubleArray Forward(long time, DoubleArray input)
        {
            TenkanMaximum.Update(time, input[HighIdx]);
            TenkanMinimum.Update(time, input[LowIdx]);
            Tenkan.Update(time, input[CloseIdx]);
            if (Tenkan.IsReady)
            {
                DelayedTenkanSenkouA.Update(time, Tenkan.Current.Value);
            }

            KijunMaximum.Update(time, input[HighIdx]);
            KijunMinimum.Update(time, input[LowIdx]);
            Kijun.Update(time, input[CloseIdx]);
            if (Kijun.IsReady)
            {
                DelayedKijunSenkouA.Update(time, Kijun.Current.Value);
            }

            SenkouA.Update(time, input[CloseIdx]);

            SenkouB.Update(time, input[CloseIdx]);
            SenkouBMaximum.Update(time, input[HighIdx]);
            if (SenkouBMaximum.IsReady)
            {
                DelayedMaximumSenkouB.Update(time, SenkouBMaximum.Current.Value);
            }
            SenkouBMinimum.Update(time, input[LowIdx]);
            if (SenkouBMinimum.IsReady)
            {
                DelayedMinimumSenkouB.Update(time, SenkouBMinimum.Current.Value);
            }

            Chikou.Update(time, input[CloseIdx]);

            return(input[CloseIdx]);
        }
예제 #2
0
        /// <summary>
        /// Computes the next value of this indicator from the given state
        /// </summary>
        /// <param name="input">The input given to the indicator</param>
        protected override decimal ComputeNextValue(IBaseDataBar input)
        {
            TenkanMaximum.Update(input.Time, input.High);
            TenkanMinimum.Update(input.Time, input.Low);
            Tenkan.Update(input.Time, input.Close);
            if (Tenkan.IsReady)
            {
                DelayedTenkanSenkouA.Update(input.Time, Tenkan.Current.Value);
            }

            KijunMaximum.Update(input.Time, input.High);
            KijunMinimum.Update(input.Time, input.Low);
            Kijun.Update(input.Time, input.Close);
            if (Kijun.IsReady)
            {
                DelayedKijunSenkouA.Update(input.Time, Kijun.Current.Value);
            }

            SenkouA.Update(input.Time, input.Close);

            SenkouB.Update(input.Time, input.Close);
            SenkouBMaximum.Update(input.Time, input.High);
            if (SenkouBMaximum.IsReady)
            {
                DelayedMaximumSenkouB.Update(input.Time, SenkouBMaximum.Current.Value);
            }
            SenkouBMinimum.Update(input.Time, input.Low);
            if (SenkouBMinimum.IsReady)
            {
                DelayedMinimumSenkouB.Update(input.Time, SenkouBMinimum.Current.Value);
            }

            Chikou.Update(input.Time, input.Close);

            return(input.Close);
        }