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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    78 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X