Example #1
0
        /// <summary>
        /// Initialization method
        /// </summary>
        public override void OnInitialize()
        {
            log.Debug("AryaStrategy onInitialize()");

            // Adding a Stochastic indicator to strategy
            // (see http://stockcharts.com/help/doku.php?id=chart_school:technical_indicators:stochastic_oscillato)
            stochasticIndicator = new StochasticIndicator(Bars.Bars, (int)this.GetInputParameter("Stochastic Period"));
            this.AddIndicator("Stochastic Indicator", stochasticIndicator);

            // Adding an ADX indicator to strategy
            // (see http://www.investopedia.com/terms/a/adx.asp)
            adxIndicator = new ADXIndicator(Bars.Bars, (int)this.GetInputParameter("ADX Period"));
            this.AddIndicator("ADX Indicator", adxIndicator);

            // Adding a SMA indicator to strategy
            // (see http://www.investopedia.com/terms/s/sma.asp)
            smaIndicator = new SMAIndicator(Bars.Close, (int)this.GetInputParameter("SMA Period"));
            this.AddIndicator("SMA Indicator", smaIndicator);
        }
        /// <summary>
        /// Initialization method
        /// </summary>
        public override void OnInitialize()
        {
            log.Debug("AryaStrategy onInitialize()");

            // Adding a Stochastic indicator to strategy
            // (see http://stockcharts.com/help/doku.php?id=chart_school:technical_indicators:stochastic_oscillato)
            stochasticIndicator = new StochasticIndicator(Bars.Bars, (int)this.GetInputParameter("Stochastic Period"));
            this.AddIndicator("Stochastic Indicator", stochasticIndicator);

            // Adding an ADX indicator to strategy
            // (see http://www.investopedia.com/terms/a/adx.asp)
            adxIndicator = new ADXIndicator(Bars.Bars, (int)this.GetInputParameter("ADX Period"));
            this.AddIndicator("ADX Indicator", adxIndicator);

            // Adding a SMA indicator to strategy
            // (see http://www.investopedia.com/terms/s/sma.asp)
            smaIndicator = new SMAIndicator(Bars.Close, (int)this.GetInputParameter("SMA Period"));
            this.AddIndicator("SMA Indicator", smaIndicator);
        }