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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    387 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    256 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    215 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    300 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    265 views
    0 likes
    Last Post CarlTrading  
    Working...
    X