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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    164 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    318 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    246 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    350 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    179 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X