Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Add multiple data series to strategy

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

    Add multiple data series to strategy

    Hello, I apologize if I don't use the right terminology in this post. I have an input series of "ADX($EURNZD (50 Renko),5)".
    My strategy uses an input series of Renko 50.

    How do I add this additional input series bars type to my strategy?
    private IDataSeries NewDataSeries= ???

    Thanks!

    #2
    ktmdave, if you want to add this in programmatically, the AddRenko() would be what you seek - https://www.ninjatrader.com/support/...7/addrenko.htm
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Ok, but how do I add the ADX(5) to this?
      ADX(AddRenko("ES 06-10", 2, MarketDataType.Last),5);
      Is this correct?


      Originally posted by NinjaTrader_Bertrand View Post
      ktmdave, if you want to add this in programmatically, the AddRenko() would be what you seek - https://www.ninjatrader.com/support/...7/addrenko.htm

      Comment


        #4
        Originally posted by ktmdave View Post
        Ok, but how do I add the ADX(5) to this?
        ADX(AddRenko("ES 06-10", 2, MarketDataType.Last),5);
        Is this correct?
        As NinjaTrader_Bertrand referenced you are going to add renko bars as a dataseries in the initialize section. This means you are creating a multi-time frame indicator where the bool BarsInProgress =-= 0 for the base series and BarsInProgress == 1 for the added renko bars.

        So in the OnbarUpDate section

        if (BarsInProgress == 1)

        Comment


          #5
          I am clear on this. I am not clear on the syntax needed to add another bars data series of ADX(5), Renko 50.

          Thank you!

          Originally posted by Tasker-182 View Post
          As NinjaTrader_Bertrand referenced you are going to add renko bars as a dataseries in the initialize section. This means you are creating a multi-time frame indicator where the bool BarsInProgress =-= 0 for the base series and BarsInProgress == 1 for the added renko bars.

          So in the OnbarUpDate section

          if (BarsInProgress == 1)

          Comment


            #6
            ktmdave, it would not be a all in one operation via the Add(), as you could not drive the bars array in Initialize() to the indicator to add. Best practice for visualization would be creating a MultiSeries indicator first that would calculate the ADX on your Renko set and then adding this MultiSeries indicator in the strategy.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by ktmdave View Post
              I am clear on this. I am not clear on the syntax needed to add another bars data series of ADX(5), Renko 50.

              Thank you!
              Sorry, something happened and I never finished my post and did not realize it even posted!

              In MTF indicators/strategies when add a data series you can work with BarsInProgress (0= base series, 1 = next added, 2= next added, 3=etc.), and you can work with BarsArray (0= base series, 1 = next added, 2= next added, 3 =etc.)

              The point is that you have added the renko bars as an input series, so the next step below the OnbarUpDate section is to:

              if (BarsInProgress == 1) // Only updates when renko bar updates
              {

              double somevariableyoucreate = ADX(BarsArray[1],5)[0]

              }

              Hope that helps.

              Comment


                #8
                Tasker, your information is getting me closer to the solution, but I still don't have understanding of the syntax. Here is some more information.
                Primary bars(barsinprogress=0): renko 50
                Secondary bars(barsinprogress=1): ADX(Renko 50,5)[0] (I don't know what the syntax is for adding this to my strategy)

                I created a dataseries:
                private IDataSeries testdataseries = null;

                Bottom line, all I really want is to set testdataseries=Closes[?]. where ? = secondary bars. This assignment will happen in Barsinprogress==0.

                Can I use testdataseries=Closes[1]? but I still don't know the syntax to add the seconday bars.

                Thoughts?
                (many thanks!)

                Comment


                  #9
                  Originally posted by ktmdave View Post
                  Tasker, your information is getting me closer to the solution, but I still don't have understanding of the syntax. Here is some more information.
                  Primary bars(barsinprogress=0): renko 50
                  Secondary bars(barsinprogress=1): ADX(Renko 50,5)[0] (I don't know what the syntax is for adding this to my strategy)

                  I created a dataseries:
                  private IDataSeries testdataseries = null;

                  Bottom line, all I really want is to set testdataseries=Closes[?]. where ? = secondary bars. This assignment will happen in Barsinprogress==0.

                  Can I use testdataseries=Closes[1]? but I still don't know the syntax to add the seconday bars.

                  Thoughts?
                  (many thanks!)
                  Sorry but I perhaps I have misunderstood what you are trying to do. if you are adding Renko bars, they would be the second data series. For clarity what is your base data series or what chart are you wanting to add the renkos too?

                  Comment


                    #10
                    My base chart is Renko 50.

                    Within barsinprogress=0, I want to do something like this(create a new data series of the closes of adx(5) of renko 50 bars, but I don't know the syntax.

                    IDataSeries testdataseries = Closes[ADX(BarsArray[0],5)];

                    BarsArray[0] is renko 50

                    Comment


                      #11
                      Originally posted by ktmdave View Post
                      My base chart is Renko 50.

                      Within barsinprogress=0, I want to do something like this(create a new data series of the closes of adx(5) of renko 50 bars, but I don't know the syntax.

                      IDataSeries testdataseries = Closes[ADX(BarsArray[0],5)];

                      BarsArray[0] is renko 50
                      Clearly I misunderstood so please accept my apologies. Here is what I think you are trying to do:

                      With a 50 renko chart, using a strategy, you want to do something with the ADX period 5 of the 50 renko. If that is correct, what is it that you want to do with that ADX output? Is it to be used to Plot a line on the chart or use the ADX value in another calculation in the strategy?

                      FYI - I have to head out shortly so will be unable to update/answer until later, hopefully Bertrand can continue to support.

                      Comment


                        #12
                        Thanks Tasker, you are correct. I want to use the ADX(5) value in another area of the strategy.
                        I think I may have the solution, but I need confirmation my syntax and logic is correct.

                        primary bars= renko 50

                        in initilize:
                        private IDataSeries testdataseries = null;

                        if (barsinprogress==0)
                        testdataseries= ADX(Close,5);

                        This would set the testdataseries to the close values of ADX(5) in renko 50 bars??

                        Comment


                          #13
                          Originally posted by ktmdave View Post
                          Thanks Tasker, you are correct. I want to use the ADX(5) value in another area of the strategy.
                          I think I may have the solution, but I need confirmation my syntax and logic is correct.

                          primary bars= renko 50

                          in initilize:
                          private IDataSeries testdataseries = null;

                          if (barsinprogress==0)
                          testdataseries= ADX(Close,5);

                          This would set the testdataseries to the close values of ADX(5) in renko 50 bars??
                          I think you are confusing terms. You are saying Dataseries when you really want a single value of ADX(5) at the moment to be used elsewhere in the strategy. So you want a single value from ADX(5) for each bar.

                          If you are using it on a 50 renko chart, all you need after the onBarUpdate then is simply

                          double somevariableyouname = ADX(5)[0];

                          Hope this helps, gotta run!

                          Comment


                            #14
                            Tasker, this worked, thanks for your help!


                            Originally posted by Tasker-182 View Post
                            I think you are confusing terms. You are saying Dataseries when you really want a single value of ADX(5) at the moment to be used elsewhere in the strategy. So you want a single value from ADX(5) for each bar.

                            If you are using it on a 50 renko chart, all you need after the onBarUpdate then is simply

                            double somevariableyouname = ADX(5)[0];

                            Hope this helps, gotta run!

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Philippe56140, Today, 02:35 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post Philippe56140  
                            Started by 00nevest, Today, 02:27 PM
                            0 responses
                            1 view
                            0 likes
                            Last Post 00nevest  
                            Started by Jonafare, 12-06-2012, 03:48 PM
                            5 responses
                            3,986 views
                            0 likes
                            Last Post rene69851  
                            Started by Fitspressorest, Today, 01:38 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post Fitspressorest  
                            Started by Jonker, Today, 01:19 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post Jonker
                            by Jonker
                             
                            Working...
                            X