Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on plotting indicator ... Index was outside the bounds of the array

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

    Error on plotting indicator ... Index was outside the bounds of the array

    I modified the NinjaTrader supplied Pivots Indicator by changing R3 and S3 to M1 and M2. It compiled and plotted fine. However, after I added M3 and M4, it compiled but does not plot. It's strange that it will plot 7 pivot lines, but not 8 or 9 pivot lines.

    The error message is: "Error on plotting indicator 'RichardPivotsTest'. Please check the 'OnBarUpdate' or the 'Plot' method: Index was outside the bounds of the array."

    I checked the forum. One suggestion is to add:
    If (CurrentBar < 1) { return; }

    I tried that but to no avail.

    I have seen this type of problems before, I managed to fix some by hit and miss. However, I can't find any good documentation to help me understand and address this type of porblems once and for all.

    Can anyone suggest a possible solution or what is the cause of this problem!

    Many thanks,

    Richard
    Attached Files
    Last edited by Richard168; 07-07-2013, 03:42 PM.

    #2
    Originally posted by Richard168 View Post
    I modified the NinjaTrader supplied Pivots Indicator by changing R3 and S3 to M1 and M2. It compiled and plotted fine. However, after I added M3 and M4, it compiled but does not plot. It's strange that it will plot 7 pivot lines, but not 8 or 9 pivot lines.

    The error message is: "Error on plotting indicator 'RichardPivotsTest'. Please check the 'OnBarUpdate' or the 'Plot' method: Index was outside the bounds of the array."

    I checked the forum. One suggestion is to add:
    If (CurrentBar < 1) { return; }

    I tried that but to no avail.

    I have seen this type of problems before, I managed to fix some by hit and miss. However, I can't find any good documentation to help me understand and address this type of porblems once and for all.

    Can anyone suggest a possible solution or what is the cause of this problem!

    Many thanks,

    Richard
    The Pivots Indicator uses a custom Plot. You need to specify the brushes for any extra plots.

    This thread answers that very question. ref: http://www.ninjatrader.com/support/f...ght=solidbrush

    Comment


      #3
      Originally posted by koganam View Post
      The Pivots Indicator uses a custom Plot. You need to specify the brushes for any extra plots.

      This thread answers that very question. ref: http://www.ninjatrader.com/support/f...ght=solidbrush
      Hi Koganam,

      Thank you so much for your help. Your suggestion works!

      Richard

      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