Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MR bug on GoTo

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

    MR bug on GoTo

    when changing a date in MR, which default starts at 12:00:00 no problem

    when using GoTo 9:30:00, these errors occur:

    Error on calling 'OnBarUpdate' method for indicator 'mystrat1' on bar 52992: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
    Error on calling 'OnBarUpdate' method for indicator 'mystrat1': You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
    Error on calling 'OnBarUpdate' method for indicator 'mystrat1' on bar 51968: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
    Error on calling 'OnBarUpdate' method for indicator 'mystrat2': You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
    Error on calling 'OnBarUpdate' method for indicator 'mystrat2' on bar 22528: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
    Error on calling 'OnBarUpdate' method for indicator 'mystrat2': You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

    I am calling this a bug because if you Reload Ninjascript there is no error. So must be something to do with MR GoTo?

    #2
    Could you please provide a reproducible scenario including all details needed (which indictaor? which replay data? etc.)

    Comment


      #3
      What else is new?

      Hello ,

      Just posting in case solution for this nasty problem should surface.
      Object reference not set to an instance of an object. a really strange message for indicator that sometimes work and sometimes doesnt as well as You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
      Bertrand has an example of an indicator Kefficiency and StochCrossTest that produces the above errors.

      I have 2 MTF indicators that work and still give errors? How come something that works complains all the time?

      Comment


        #4
        I have no idea what is causing this error

        I have one custom strat that calls a custom ind....and another chart with a custom ind

        Even though this code is in place in all custom code:


        if (CurrentBar < 20 )
        return;

        I still get the error using GoTo 8:30 and back to 9:30

        Perhaps the error is an example.....i.e. 4 bars 5 bars
        Last edited by ATI user; 01-30-2010, 05:59 PM.

        Comment


          #5
          ATI user,

          The message is indeed just an example. It may not necessarily be that exact case either. What you would want to try and do is add in some try-catch blocks in your code and try to isolate out where it occurred.
          Josh P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          606 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          351 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          560 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          561 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X