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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      45 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      14 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      22 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X