Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Please help with Object reference not set...

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

    Please help with Object reference not set...

    Hello,

    The attached screenshot from my strategy log shows an error occurs between a "Pending Change" and an "Accepted" state of "stopa" order.

    http://screencast.com/t/8tkmH6EiKb6T
    I've been verifying stopOrder names and adding null checks throughout my code but haven't been able to find this offending reference. The error occurs upon moving a stop from it's initial stop location to breakeven +1 tick.

    Could a simple assignment of a stop price be the culprit?
    Code:
    stopPrice = stopOrder_1a.StopPrice;
    I'm now testing this ...
    Code:
    if (stopOrder_1a != null) stopPrice = stopOrder_1a.StopPrice;
    Also, I'm researching other breakeven codes I have but want to know if the OnBarUpdate section, OnOrderUpdate, or OnExecution is the most likely place where this error is produced.

    Thanks,
    Kirk
    Last edited by zeller4; 02-08-2012, 08:25 AM.

    #2
    zeller,

    I would suggest using a Try/Catch block to see if it can pinpoint which line is causing the issue. Please find a reference sample below.



    Once you use this, it will print the offending line in your Tools > Output Window.

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    656 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    371 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X