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

Strategy Data Series

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

    Strategy Data Series

    Can I reference standard candles and renko bars in the same strategy? If so, how?

    Thanks in advance!!

    #2
    Hi RiversideDude,

    Yes, you can reference multiple bar types in a strategy including Renko.
    AddRenko(string instrumentName, int brickSize, MarketDataType marketDataType)

    Please see the help guide on AddRenko() and Add().
    AddRenko() - http://ninjatrader.com/support/helpG...7/addrenko.htm
    Add() - http://ninjatrader.com/support/helpGuides/nt7/add3.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      So once I have both data series, I want to add moving averages and MACD based on both of them. Is there an example of how to do that?

      Thanks in advance!

      Comment


        #4
        Hello RiversideDude,

        Use the BarsArray with the proper index as the input series for the indicator call.

        Below is a link to the help guide on the SMA.
        http://ninjatrader.com/support/helpG...simple_sma.htm

        And a link to the help guide on BarsInProgress.
        http://ninjatrader.com/support/helpG...inprogress.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Is there an option to leave the instrument name blank when you use AddRenko()? I want it to default to the instrument of the chart that it's running against.

          Thanks!!
          Last edited by RiversideDude; 04-21-2016, 04:20 PM.

          Comment


            #6
            Hello RiversideDude,

            No, you must supply the Instrument name.

            Below I am providing a link to the help guide on AddRenko() which lists all overloads that you can use.
            http://ninjatrader.com/support/helpG...7/addrenko.htm

            To supply the primary instruments name use Instrument.FullName.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thanks. They should add that to the documentation.

              Comment


                #8
                When you add a strategy to a chart is there a way to NOT have it process historical bars and only process bars closed going forward?

                Thanks!!

                Comment


                  #9
                  I added the attached strategy to a chart and I expected the output for each data series to be the same but it wasn't. Why not?

                  Thanks!!
                  Attached Files

                  Comment


                    #10
                    Originally posted by RiversideDude View Post
                    I added the attached strategy to a chart and I expected the output for each data series to be the same but it wasn't. Why not?

                    Thanks!!

                    You really need to read this:

                    Comment


                      #11
                      Ok, I read through it. It answered one of my questions, but not why the data series aren't showing the same data. I'm creating a 15 minute chart with an additional 15 minute data series just so that I can learn how it loops through the array.

                      Maybe it doesn't matter, the first 5 to 6 digits to the right of the decimal are the same.

                      Thanks!!
                      Last edited by RiversideDude; 04-21-2016, 09:35 PM.

                      Comment


                        #12
                        Originally posted by RiversideDude View Post

                        Maybe it doesn't matter, the first 5 to 6 digits to the right of the decimal are the same.

                        Thanks!!
                        Yeah, but you should start finding issues with indexes out of range when using different timeframes....

                        NT_CB mentioned this, but I saw nothing in your posted code about this:


                        Comment


                          #13
                          Please don't reply to anymore of my questions sledge. Your response seems unprofessional and rude. Keep in mind that I'm trying to learn your system so that I can eventually give you my money!

                          Thanks!!

                          Comment


                            #14
                            Hi RiversideDude,

                            I just want to be clear about what you are viewing and your environment.

                            On the chart, a 15 minute series is selected correct?

                            In the script there is an Add(PeriodType.Minute, 15); and no other Add calls, is this correct?

                            Are you printing the values of the Close[0] to the output window with the Time[0] of the bar?

                            What is the output you are getting in your output window?

                            Attached is a script I have made to test this as well as the output I have received. I am finding that the prints on the ES 06-16 are the same for both series.
                            (NinjaTrader will not actually create a new series if the instrument and interval match an existing series. Instead it will re-use the existing series to be more efficient. This means the values should be the same)

                            Can I have you show me the code you are testing and the output you are getting?


                            On a small note, sledge is a community member who is attempting to assist you but does not represent NinjaTrader Support.
                            Attached Files
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              First let me say, I have lots of programming experience, I'm just new to NT. I have 2k lines in TS II that I want to convert over.

                              So I created the strategy and I add it to a chart with the same data series (AUD/JPY, 15 minutes bid) I was just testing to see that my understanding of how NT was looping through the array was correct. When I printed the values I expected them to be exactly the same but they weren't, so that's why I asked.

                              So yes, no other ADD() and it was a 15 minute chart. I only trade currencies.

                              I attached my code to my earlier post. And the output showed different values for the SMA(20) even though the dataseries was the same.

                              Is there a way to find out which bar is actually being processed?

                              Ok, I thought he worked for NT.

                              Thanks ChelseaB!!
                              Last edited by RiversideDude; 04-22-2016, 12:28 PM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rbeckmann05, Yesterday, 06:48 PM
                              1 response
                              12 views
                              0 likes
                              Last Post bltdavid  
                              Started by llanqui, Today, 03:53 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post llanqui
                              by llanqui
                               
                              Started by burtoninlondon, Today, 12:38 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post burtoninlondon  
                              Started by AaronKoRn, Yesterday, 09:49 PM
                              0 responses
                              15 views
                              0 likes
                              Last Post AaronKoRn  
                              Started by carnitron, Yesterday, 08:42 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post carnitron  
                              Working...
                              X