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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    64 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X