Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with multiple data

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

    Problems with multiple data

    I added a 45 minute chart to my 15 minute chart

    When referencing Highs[1].Count I see the value as 176

    However, when I reference Highs[1][21] or greater, I get an error telling me that the index is out of range.

    I confirmed the Highs[1].Count value by using Visual Studio and attaching it to NT

    Please help

    #2
    update, in my code i set

    IDataSeries[] ds = Highs;

    and using the Visual Studio inspector I looked all through the IDataSeries[] object and confirmed that there is 176 sets of data. No clue as to why it gives me an out of index range error for anything over 20

    Comment


      #3
      Not sure clam61, it might be related to this - http://www.ninjatrader-support2.com/...ead.php?t=3170

      Comment


        #4
        but i see that the dataseries objects count is 176. i even inspected the dataseries object and i see 176 pieces of data.

        anyways, currentbar relates to original the dataseries of the chart, not of the added dataseries, right?

        Comment


          #5
          CurrentBar has nothing to do with custom DataSeries objects. CurrentBar holds the count of the bars series.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            i thought so. so could you explain how the post you recommended applies to my situation?



            Highs[1].Count gives me 176 but when I try Highs[1][21] it gives me an index out of range error...even though I see 176 sets of data when I inspect the object
            Last edited by clam61; 05-26-2009, 04:47 PM.

            Comment


              #7
              found the problem.

              apparently there is a bug when reading data from the second data series during the historical loading...despite the dataseries object saying there is sufficient count, you cant access it

              Comment


                #8
                clam61, please use CurrentBar to access the count of your bars series as Josh posted. Please do not use .Count to access this.

                Comment


                  #9
                  my strategy needs to reference past data of a series added through Add()

                  how can i use CurrentBar? CurrentBar refers to the original dataseries of the chart.

                  Comment


                    #10
                    if (BarsInProgress == 0)

                    CurrentBar used inside BIP=0 will be the current bar of that series. In BIP = 1 would be of that series, etc.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      awesome thank you

                      Comment


                        #12
                        found the actual issue.

                        had nothing to do with CurrentBar vs Count

                        the Min required bars was not met for the added dataset which was larger timeframe but it was met for the smaller timeframe

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        663 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        376 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        110 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        575 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        580 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X