Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer error

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

    Strategy Analyzer error

    I get this error when I run the my strategy in Strategy Analyzer, but I do not get the error when I run the strategy normally with live data.

    28/01/2010 12:08:00 PM System.NullReferenceException: Object reference not set to an instance of an object.
    at NinjaTrader.Strategy.gcCurrencyRange.get_Now()
    at NinjaTrader.Strategy.gcCurrencyRange.CheckExcluded Periods()
    at NinjaTrader.Strategy.gcCurrencyRange.OnBarUpdate()
    I believe from the error description that the offending code is what I have inserted below.
    Code:
    //******************
    private DateTime Now
    //******************
    {
    get { return (Bars.MarketData.Connection.Options.Provider == Cbi.Provider.Replay ? Bars.MarketData.Connection.Now : Historical? Time[0]:DateTime.Now); }
    }
    Have any of the NT classes in my code above changed in version 7? I could not find anything listed in the "Code-Breaking changes for NT7"

    thanks

    #2
    Likely when you call this property, one of the properrties is of course null. There could be changes that we have made between 6.5 and 7 in this unsupported area. You would have to add some null reference checks in your "getter".
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    605 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    351 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    560 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    561 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X