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 Belfortbucks, Today, 09:29 PM
      0 responses
      6 views
      0 likes
      Last Post Belfortbucks  
      Started by zstheorist, Today, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      151 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      6 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Working...
      X