Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DataSeries.ContainsValue unexpected behavior

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

    DataSeries.ContainsValue unexpected behavior

    I am getting an 'Index out of range' exception using the DataSeries.ContainsValue(0) method.
    I was under the impression that the DataSeries.ContainsValue method should be used to determine if any given bar had a value set by my indicator. My expectation is that it would return false if I did not call the Set() method for that bar.

    However, on a chart with greater than 255 bars, I get an index out of range exception.
    I tried setting MaximumBarsLookBack = MaximumBarsLookBack.Infinite in the Initialize() method and this did not solve the problem.

    I have attached a do-nothing indicator that shows the problem by printing the exception output to the output window.

    Can anybody tell me what I am doing wrong?

    Thanks,
    Gary
    Attached Files

    #2
    You're not doing anything wrong, you've found a bug in NT7, it shouldn't behave like that.

    FYI I recommend instantiating new data series (or anything else) in OnStartUp. Very little goes in Initialize() in NT7, only Bars Objects and Plots.

    protected override void OnStartUp()
    {
    mySeries = new DataSeries(this,MaximumBarsLookBack.Infinite);
    }


    but that's not your problem here.

    Comment


      #3
      Gary and Kevin, thanks for reporting in, we'll take a look into the issue shortly.

      Comment


        #4
        Gary, thanks for the testfile, could reproduce this breaking at 255 bars on the chart - we'll look into.

        Comment


          #5
          Thanks for reporting in this bug and for providing the test snippet - we added a fix for Beta 18 - please retest then - thanks.

          Comment


            #6
            Beta 18?

            Do you have an ETA for Beta 18?

            -Gary

            Comment


              #7
              Hi Gary, unfortunately I would not have one at this point in time.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              599 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              344 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              558 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              557 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X