SPUD Stochastic Theory Indicator

by Владимир Владимиров in category Oscilator at 19/12/2015
Description

In accordance with the description of the SPUD's theory on the http://www.forexfactory.com/showthread.php?t=37111 indicator shows the corresponding status.

Download
1107 downloads
How to install
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(AccessRights = AccessRights.None)]
    public class Stpmt : Indicator
    {
        private StochasticOscillator _stochastic6;
        private StochasticOscillator _stochastic7;
        private StochasticOscillator _stochastic8;
        private StochasticOscillator _stochastic9;
        private StochasticOscillator _stochastic10;
        private StochasticOscillator _stochastic11;
        private StochasticOscillator _stochastic12;
        private StochasticOscillator _stochastic13;
        private StochasticOscillator _stochastic14;
        private StochasticOscillator _stochastic15;
        private StochasticOscillator _stochastic16;
        private StochasticOscillator _stochastic17;
        private StochasticOscillator _stochastic18;
        private StochasticOscillator _stochastic19;
        private StochasticOscillator _stochastic20;
        private StochasticOscillator _stochastic21;
        private StochasticOscillator _stochastic22;
        private StochasticOscillator _stochastic23;
        private StochasticOscillator _stochastic24;

        [Parameter("MA Type", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType MaType { get; set; }

        [Output("DataSeries6", Color = Colors.LightGray, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries6 { get; set; }

        [Output("DataSeries7", Color = Colors.LightGray, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries7 { get; set; }

        [Output("DataSeries8", Color = Colors.LightGray, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries8 { get; set; }

        [Output("DataSeries9", Color = Colors.LightGray, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries9 { get; set; }

        [Output("DataSeries10", Color = Colors.LightGray, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries10 { get; set; }

        [Output("DataSeries11", Color = Colors.LightGray, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries11 { get; set; }

        [Output("DataSeries12", Color = Colors.LightGray, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries12 { get; set; }

        [Output("DataSeries13", Color = Colors.LightGray, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries13 { get; set; }

        [Output("DataSeries14", Color = Colors.Red, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries14 { get; set; }

        [Output("DataSeries15", Color = Colors.Purple, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries15 { get; set; }

        [Output("DataSeries16", Color = Colors.Purple, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries16 { get; set; }

        [Output("DataSeries17", Color = Colors.Purple, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries17 { get; set; }

        [Output("DataSeries18", Color = Colors.Purple, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries18 { get; set; }

        [Output("DataSeries19", Color = Colors.Purple, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries19 { get; set; }

        [Output("DataSeries20", Color = Colors.Purple, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries20 { get; set; }

        [Output("DataSeries21", Color = Colors.Purple, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries21 { get; set; }

        [Output("DataSeries22", Color = Colors.Purple, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries22 { get; set; }

        [Output("DataSeries23", Color = Colors.Purple, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries23 { get; set; }

        [Output("DataSeries24", Color = Colors.Purple, LineStyle = LineStyle.Solid)]
        public IndicatorDataSeries DataSeries24 { get; set; }

        protected override void Initialize()
        {
            _stochastic6 = Indicators.StochasticOscillator(6, 3, 3, MaType);
            _stochastic7 = Indicators.StochasticOscillator(7, 3, 3, MaType);
            _stochastic8 = Indicators.StochasticOscillator(8, 3, 3, MaType);
            _stochastic9 = Indicators.StochasticOscillator(9, 3, 3, MaType);
            _stochastic10 = Indicators.StochasticOscillator(10, 3, 3, MaType);
            _stochastic11 = Indicators.StochasticOscillator(11, 3, 3, MaType);
            _stochastic12 = Indicators.StochasticOscillator(12, 3, 3, MaType);
            _stochastic13 = Indicators.StochasticOscillator(13, 3, 3, MaType);
            _stochastic14 = Indicators.StochasticOscillator(14, 3, 3, MaType);
            _stochastic15 = Indicators.StochasticOscillator(15, 3, 3, MaType);
            _stochastic16 = Indicators.StochasticOscillator(16, 3, 3, MaType);
            _stochastic17 = Indicators.StochasticOscillator(17, 3, 3, MaType);
            _stochastic18 = Indicators.StochasticOscillator(18, 3, 3, MaType);
            _stochastic19 = Indicators.StochasticOscillator(19, 3, 3, MaType);
            _stochastic20 = Indicators.StochasticOscillator(20, 3, 3, MaType);
            _stochastic21 = Indicators.StochasticOscillator(21, 3, 3, MaType);
            _stochastic22 = Indicators.StochasticOscillator(22, 3, 3, MaType);
            _stochastic23 = Indicators.StochasticOscillator(23, 3, 3, MaType);
            _stochastic24 = Indicators.StochasticOscillator(24, 3, 3, MaType);
        }
        public override void Calculate(int index)
        {
            DataSeries6[index] = _stochastic6.PercentK[index];
            DataSeries7[index] = _stochastic7.PercentK[index];
            DataSeries8[index] = _stochastic8.PercentK[index];
            DataSeries9[index] = _stochastic9.PercentK[index];
            DataSeries10[index] = _stochastic10.PercentK[index];
            DataSeries11[index] = _stochastic11.PercentK[index];
            DataSeries12[index] = _stochastic12.PercentK[index];
            DataSeries13[index] = _stochastic13.PercentK[index];
            DataSeries14[index] = _stochastic14.PercentK[index];
            DataSeries15[index] = _stochastic15.PercentK[index];
            DataSeries16[index] = _stochastic16.PercentK[index];
            DataSeries17[index] = _stochastic17.PercentK[index];
            DataSeries18[index] = _stochastic18.PercentK[index];
            DataSeries19[index] = _stochastic19.PercentK[index];
            DataSeries20[index] = _stochastic20.PercentK[index];
            DataSeries21[index] = _stochastic21.PercentK[index];
            DataSeries22[index] = _stochastic22.PercentK[index];
            DataSeries23[index] = _stochastic23.PercentK[index];
            DataSeries24[index] = _stochastic24.PercentK[index];
        }
    }
}
Comments
0