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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    47 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    15 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X