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