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

bar objects

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

    bar objects

    the last time I added additional bar objects to my script I got a bit confused
    so can I first check with the experts ...

    with COBC = false & true

    Is there any preference to adding a 15min bar object to a 60min chart

    or

    adding a 60min bar object to a 15min chart?

    #2
    Hello futurenets,

    Thank you for your note.

    It would not matter which is added first, however you will need to know which is the primary series and which is the secondary series that was added in code. This way you can properly can the BarsInProgress int.

    Please refer to the following link for more information: http://www.ninjatrader.com/support/h...nstruments.htm

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

    Comment


      #3
      ok thanks.

      just a quick question ... after adding a 60min bar object how do I get RSI for this additional object

      e.g.

      myDS.Set(RSI(period,
      0)[0]);


      Comment


        #4
        Hello futurenets,

        Thank you for your response.

        Are you asking how to call the DataSeries or how to pass the secondary series (60 Minute) as the input for the RSI in the DataSeries?

        Comment


          #5
          if BarsArray[1] is a 60min bar object on a 15min chart, am I right that

          myRSI.Set(RSI(BarsArray[1], 14,0)[0]);

          is ok even though series may include the 15min interhour bars?

          this code creates different LLV & HHV on 15min chart with 60min bar object when compared to 60min chart:

          myRSI.Set(RSI(14,0)[0]);
          if(FirstTickOfBar)
          {
          LLV = MIN(myRSI,
          14)[0];
          HHV = MAX(myRSI,
          14)[0];
          }
          else
          {
          LLV = Math.Min(myRSI[
          0], LLV);
          HHV = Math.Max(myRSI[
          0], HHV);
          }

          myRSI is ok


          Attached Files
          Last edited by futurenets; 06-03-2015, 07:32 AM.

          Comment


            #6
            Hello futurenets,

            Thank you for your response.

            I may not fully understand your inquiry. Your attached script shows you using a double (which should be fine) but you are asking about the DataSeries. Can you clarify on what matter your on inquiring about?

            I look forward to your response.

            Comment


              #7
              results on 15min chart using 60min bar object not the same as 60min chart

              should myRSI[0], myRSI[1], myRSI[2] of 60 min bar object on 15 min chart match

              myRSI[0], myRSI[1], myRSI[2] on 60min chart.

              It doesn't.

              how is a 60min bar object series organised on a 15 minute chart

              e.g does each 15minute element have a corresponding 60minute element?

              see attached RSIoutput.png
              Attached Files
              Last edited by futurenets; 06-03-2015, 09:41 AM.

              Comment


                #8
                Hello futurenets,

                Thank you for your response.

                When adding in the additional series you would then separate logic with BarsInProgress: http://www.ninjatrader.com/support/h...inprogress.htm
                More information on multiple series sin your script can be found at the following link: http://www.ninjatrader.com/support/h...nstruments.htm

                However, you are talking about DataSeries objects and you would need to sync the DataSeries object to the secondary series to ensure it pulls those values properly. Please refer to the reference sample at the following link for more information: http://www.ninjatrader.com/support/f...ead.php?t=3572

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

                Comment


                  #9
                  ok thanks.

                  yes did separate using BarsInProgress (see attached ntTest.zip).

                  I really wanted to know what myRSI[1] & myRSI[2] represents as shown in the attached RSIoutput.png.

                  In a 60 minute chart with COBC=true these represent data belonging to bars 1 & 2 but in a 15min chart with a 60min bar object I have no idea?
                  Last edited by futurenets; 06-03-2015, 10:34 AM.

                  Comment


                    #10
                    sync worked thank you.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by judysamnt7, 03-13-2023, 09:11 AM
                    4 responses
                    59 views
                    0 likes
                    Last Post DynamicTest  
                    Started by ScottWalsh, Today, 06:52 PM
                    4 responses
                    36 views
                    0 likes
                    Last Post ScottWalsh  
                    Started by olisav57, Today, 07:39 PM
                    0 responses
                    7 views
                    0 likes
                    Last Post olisav57  
                    Started by trilliantrader, Today, 03:01 PM
                    2 responses
                    21 views
                    0 likes
                    Last Post helpwanted  
                    Started by cre8able, Today, 07:24 PM
                    0 responses
                    10 views
                    0 likes
                    Last Post cre8able  
                    Working...
                    X