Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

debugging ninjascript "index out of range"

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

    debugging ninjascript "index out of range"

    Hello,

    Is there any way from the log to tell what line in the code in which method caused these errors? In a long section of code it could happen in many places.

    Thank you.

    (I understand what the error is...I don't know where it occurred in the code...thanks).

    ================================================== ==========

    6/29/2010 13:13 Default Error on calling the 'OnBarUpdate' method for indicator 'Axe' on bar 2: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    6/29/2010 13:13 Default Error on calling the 'OnBarUpdate' method for indicator 'Axe' on bar 5: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    #2
    Hi Turtle Trader,

    You can use try/catch blocks to narrow down where the cause of the issues are coming from.

    You can use them in combination with Print() statements to see if you are getting the values you expect.

    Try/Catch info at - http://www.ninjatrader.com/support/f...ead.php?t=9825
    Using Print() - http://www.ninjatrader.com/support/f...ead.php?t=3418
    TimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    600 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    347 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
    558 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X