Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 warreng86, 11-10-2020, 02:04 PM
      7 responses
      1,360 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Perr0Grande, Today, 08:16 PM
      0 responses
      5 views
      0 likes
      Last Post Perr0Grande  
      Started by elderan, Today, 08:03 PM
      0 responses
      9 views
      0 likes
      Last Post elderan
      by elderan
       
      Started by algospoke, Today, 06:40 PM
      0 responses
      10 views
      0 likes
      Last Post algospoke  
      Started by maybeimnotrader, Today, 05:46 PM
      0 responses
      14 views
      0 likes
      Last Post maybeimnotrader  
      Working...
      X