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 Hwop38, 05-04-2026, 07:02 PM
              0 responses
              161 views
              0 likes
              Last Post Hwop38
              by Hwop38
               
              Started by CaptainJack, 04-24-2026, 11:07 PM
              0 responses
              308 views
              0 likes
              Last Post CaptainJack  
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              245 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              349 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by M4ndoo, 04-19-2026, 05:54 PM
              0 responses
              179 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Working...
              X