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