• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja ElliottOscillator Editing Question

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    here is a screenshot...it does not seem to working as same color above and below zero line and neutral is transparent...thanks
    C:\Users\brian\Downloads\cs_file2.png

    Comment


      #17
      Sorry Brian, we could not access those screenshots you post? Can you please directly attach here? Did you use the exact version that I posted?
      BertrandNinjaTrader Customer Service

      Comment


        #18
        I posted exactly what you had...try this link (not sure how to attach a pic directly...asks for link to image with no other choice...thanks
        https://www.dropbox.com/s/dzfkbx9j4b4fz40/cs_file2.png
        //
        // Copyright (C) 2006, NinjaTrader LLC <[email protected]>.
        // NinjaTrader reserves the right to modify or overwrite this NinjaScript component with each release.
        //

        #region Using declarations
        using System;
        using System.Diagnostics;
        using System.Drawing;
        using System.Drawing.Drawing2D;
        using System.ComponentModel;
        using System.Xml.Serialization;
        using NinjaTrader.Data;
        using NinjaTrader.Gui.Chart;
        #endregion

        // This namespace holds all indicators and is required. Do not change it.
        namespace NinjaTrader.Indicator
        {
        /// <summary>
        /// Elliot Oscillator
        /// </summary>
        [Description("The Elliot Oscillator is a trend following momentum indicator that shows the relationship between two moving averages of prices.")]
        [Gui.Design.DisplayName("Elliot Oscillator")]
        public class ElliotOscillator2 : Indicator
        {
        #region Variables
        private int fast = 5;
        private int slow = 34;
        private double elliot = 0;
        private double elliot3 = 0;
        private DataSeries fastEma;
        private DataSeries slowEma;
        #endregion

        /// <summary>
        /// This method is used to configure the indicator and is called once before any bar data is loaded.
        /// </summary>
        protected override void Initialize()
        {
        Add(new Plot(Color.Transparent, "Elliot"));
        Add(new Plot(new Pen(Color.Blue, 3), PlotStyle.Bar, "UpTrend"));
        Add(new Plot(new Pen(Color.Red, 3), PlotStyle.Bar, "DownTrend"));
        Add(new Plot(Color.Red, "Elliot Displaced"));
        Add(new Line(Color.DarkGray, 0, "Zero line"));

        fastEma = new DataSeries(this);
        slowEma = new DataSeries(this);
        CalculateOnBarClose = true;
        PriceTypeSupported = true;
        AutoScale = true;
        }

        /// <summary>
        /// Calculates the indicator value(s) at the current index.
        /// </summary>
        protected override void OnBarUpdate()
        {
        if (CurrentBar < 3)
        return;

        if (CurrentBar == 0)
        {
        fastEma.Set(Input[0]);
        slowEma.Set(Input[0]);
        Value.Set(0);
        Elliott3.Set(0);
        }
        else
        {
        fastEma.Set(SMA(fast)[0]);
        slowEma.Set(SMA(slow)[0]);
        elliot = ((fastEma[0] - slowEma[0]));
        elliot3 = ((fastEma[3] - slowEma[3]));

        Value.Set(elliot);
        Elliott3.Set(elliot3);

        if (Value[0] > 0)
        Uptrend.Set(elliot);
        else if (Value[0] < 0)
        Downtrend.Set(elliot);

        }
        }

        #region Properties
        /// <summary>
        /// </summary>
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries Default
        {
        get { return Values[0]; }
        }
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries Uptrend
        {
        get { return Values[1]; }
        }

        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries Downtrend
        {
        get { return Values[2]; }
        }

        /// <summary>
        /// </summary>
        [Browsable(false)]
        [XmlIgnore()]
        public DataSeries Elliott3
        {
        get { return Values[3]; }
        }




        /// <summary>
        /// </summary>
        [Description("Number of bars for fast SMA")]
        [Category("Parameters")]
        public int Fast
        {
        get { return fast; }
        set { fast = Math.Max(1, value); }
        }

        /// <summary>
        /// </summary>
        [Description("Number of bars for slow SMA")]
        [Category("Parameters")]
        public int Slow
        {
        get { return slow; }
        set { slow = Math.Max(1, value); }
        }

        #endregion
        }
        }

        #region NinjaScript generated code. Neither change nor remove.
        // This namespace holds all indicators and is required. Do not change it.
        namespace NinjaTrader.Indicator
        {
        public partial class Indicator : IndicatorBase
        {
        private ElliotOscillator2[] cacheElliotOscillator2 = null;

        private static ElliotOscillator2 checkElliotOscillator2 = new ElliotOscillator2();

        /// <summary>
        /// The Elliot Oscillator is a trend following momentum indicator that shows the relationship between two moving averages of prices.
        /// </summary>
        /// <returns></returns>
        public ElliotOscillator2 ElliotOscillator2(int fast, int slow)
        {
        return ElliotOscillator2(Input, fast, slow);
        }

        /// <summary>
        /// The Elliot Oscillator is a trend following momentum indicator that shows the relationship between two moving averages of prices.
        /// </summary>
        /// <returns></returns>
        public ElliotOscillator2 ElliotOscillator2(Data.IDataSeries input, int fast, int slow)
        {
        if (cacheElliotOscillator2 != null)
        for (int idx = 0; idx < cacheElliotOscillator2.Length; idx++)
        if (cacheElliotOscillator2[idx].Fast == fast && cacheElliotOscillator2[idx].Slow == slow && cacheElliotOscillator2[idx].EqualsInput(input))
        return cacheElliotOscillator2[idx];

        lock (checkElliotOscillator2)
        {
        checkElliotOscillator2.Fast = fast;
        fast = checkElliotOscillator2.Fast;
        checkElliotOscillator2.Slow = slow;
        slow = checkElliotOscillator2.Slow;

        if (cacheElliotOscillator2 != null)
        for (int idx = 0; idx < cacheElliotOscillator2.Length; idx++)
        if (cacheElliotOscillator2[idx].Fast == fast && cacheElliotOscillator2[idx].Slow == slow && cacheElliotOscillator2[idx].EqualsInput(input))
        return cacheElliotOscillator2[idx];

        ElliotOscillator2 indicator = new ElliotOscillator2();
        indicator.BarsRequired = BarsRequired;
        indicator.CalculateOnBarClose = CalculateOnBarClose;
        #if NT7
        indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
        indicator.MaximumBarsLookBack = MaximumBarsLookBack;
        #endif
        indicator.Input = input;
        indicator.Fast = fast;
        indicator.Slow = slow;
        Indicators.Add(indicator);
        indicator.SetUp();

        ElliotOscillator2[] tmp = new ElliotOscillator2[cacheElliotOscillator2 == null ? 1 : cacheElliotOscillator2.Length + 1];
        if (cacheElliotOscillator2 != null)
        cacheElliotOscillator2.CopyTo(tmp, 0);
        tmp[tmp.Length - 1] = indicator;
        cacheElliotOscillator2 = tmp;
        return indicator;
        }
        }
        }
        }

        // This namespace holds all market analyzer column definitions and is required. Do not change it.
        namespace NinjaTrader.MarketAnalyzer
        {
        public partial class Column : ColumnBase
        {
        /// <summary>
        /// The Elliot Oscillator is a trend following momentum indicator that shows the relationship between two moving averages of prices.
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.ElliotOscillator2 ElliotOscillator2(int fast, int slow)
        {
        return _indicator.ElliotOscillator2(Input, fast, slow);
        }

        /// <summary>
        /// The Elliot Oscillator is a trend following momentum indicator that shows the relationship between two moving averages of prices.
        /// </summary>
        /// <returns></returns>
        public Indicator.ElliotOscillator2 ElliotOscillator2(Data.IDataSeries input, int fast, int slow)
        {
        return _indicator.ElliotOscillator2(input, fast, slow);
        }
        }
        }

        // This namespace holds all strategies and is required. Do not change it.
        namespace NinjaTrader.Strategy
        {
        public partial class Strategy : StrategyBase
        {
        /// <summary>
        /// The Elliot Oscillator is a trend following momentum indicator that shows the relationship between two moving averages of prices.
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.ElliotOscillator2 ElliotOscillator2(int fast, int slow)
        {
        return _indicator.ElliotOscillator2(Input, fast, slow);
        }

        /// <summary>
        /// The Elliot Oscillator is a trend following momentum indicator that shows the relationship between two moving averages of prices.
        /// </summary>
        /// <returns></returns>
        public Indicator.ElliotOscillator2 ElliotOscillator2(Data.IDataSeries input, int fast, int slow)
        {
        if (InInitialize && input == null)
        throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

        return _indicator.ElliotOscillator2(input, fast, slow);
        }
        }
        }
        #endregion

        Comment


          #19
          Right, that's file I sent you, but it seems it's not the one you actually then chart? You seen to call the UpDn variation?
          BertrandNinjaTrader Customer Service

          Comment


            #20
            Got it...now it works...thank you so much for all your help.

            Comment


              #21
              hey yall, has anyone converted this indi to NT8??

              Comment


                #22
                has anyone transcribed this indicator to NT8?

                Comment


                  #23
                  Hello raptureye,

                  I will take a look into this item to see if it can be converted into NT8 format. Once I have more details I will reply back here.

                  I do want to mention that conversions are not a service that our support offers but it looks like Bertrand had previously uploaded an indicator named "EWO2.cs" which I can review to see about an NT8 version.

                  I look forward to being of further assistance.
                  JesseNinjaTrader Customer Service

                  Comment


                    #24
                    Hi Jesse, of course so thank you, I appreciate what you can find out on y'all's end!

                    Comment


                      #25
                      Hello raptureye,

                      It looks like the other item is fairly simple and is just a few plots in addition to the calculation. I went ahead and moved this over to an NT8 script as there was really no conversion needed here, just the correct NT8 syntax modifications were needed.


                      Please let me know if I may be of further assistance.

                      Attached Files
                      JesseNinjaTrader Customer Service

                      Comment


                        #26
                        epic thanks Jesse!

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by brucerobinson, Today, 10:27 AM
                        1 response
                        1 view
                        0 likes
                        Last Post NinjaTrader_PatrickG  
                        Started by Emma1, Today, 10:25 AM
                        2 responses
                        4 views
                        0 likes
                        Last Post Emma1
                        by Emma1
                         
                        Started by RedDuke, Today, 10:21 AM
                        1 response
                        4 views
                        0 likes
                        Last Post NinjaTrader_PatrickG  
                        Started by Parmenides48, Today, 10:12 AM
                        0 responses
                        11 views
                        0 likes
                        Last Post Parmenides48  
                        Started by Ron77, Today, 09:05 AM
                        4 responses
                        20 views
                        0 likes
                        Last Post Ron77
                        by Ron77
                         
                        Working...
                        X