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 CaptainJack, 05-29-2026, 05:09 AM
              0 responses
              265 views
              0 likes
              Last Post CaptainJack  
              Started by CaptainJack, 05-29-2026, 12:02 AM
              0 responses
              169 views
              0 likes
              Last Post CaptainJack  
              Started by charlesugo_1, 05-26-2026, 05:03 PM
              0 responses
              171 views
              1 like
              Last Post charlesugo_1  
              Started by DannyP96, 05-18-2026, 02:38 PM
              1 response
              259 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 05-11-2026, 05:56 AM
              0 responses
              210 views
              0 likes
              Last Post CarlTrading  
              Working...
              X