Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Null Reference exception during optimization

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

    Null Reference exception during optimization

    Code:
    System.NullReferenceException was unhandled
    Message: An unhandled exception of type 'System.NullReferenceException' occurred in mscorlib.dll
    Additional information: Object reference not set to an instance of an object.
    got this when doing optimization on a strategy.


    settings...

    using default optimizer on profit factor

    and call Stack
    Last edited by aufidius; 07-28-2015, 06:21 PM.

    #2
    I was worried that maybe something got corrupted in my migration of NT7 to NT8 data so I reinstalled and didn't import my NT7 settings.

    Using EOD data from Kinetic i'm getting the same error from the MACross strategy.

    Comment


      #3
      anyone else getting this?

      Comment


        #4
        We've had a view similar reports. Can you please try putting the following in State.SetDefaults

        Code:
        protected override void OnStateChange()
        {
             if (State == State.SetDefaults)
             {
                  // Set to true for debug purposes. If optimization results were off when this was set to false there
                  // likely is a user variable reset issue that needs to be addressed
                  IsInstantiatedOnEachOptimizationIteration = true;
             }
        }
        If this does not help, can you please email your log/trace files to platformsupport[at]ninjatrader[com]
        MatthewNinjaTrader Product Management

        Comment


          #5
          that resolved the issue.

          Comment


            #6
            Thanks for confirming, but you shouldn't necessarily need to do that to prevent such an error depending on how the strategy is coded. Can you send us a reproduction of the error to support at NinjaTrader dot com? We likely only need the OnStateChange logic if you can provide that logic at the minimum
            MatthewNinjaTrader Product Management

            Comment


              #7
              Bad news...

              Last night my machine upgraded from Windows 8.1 to Windows 10 and now I am unable to reproduce the error. All strategies work fine without the change mentioned earlier.

              Maybe the issue is related to specific versions of the .NET runtime? Either way if it happens again I'll email in the log data.

              Comment


                #8
                Interesting... well thanks for the update. We'll keep our eyes peeled as well.
                MatthewNinjaTrader Product Management

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by cls71, Today, 04:45 AM
                0 responses
                1 view
                0 likes
                Last Post cls71
                by cls71
                 
                Started by mjairg, 07-20-2023, 11:57 PM
                3 responses
                213 views
                1 like
                Last Post PaulMohn  
                Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                4 responses
                544 views
                0 likes
                Last Post PaulMohn  
                Started by GLFX005, Today, 03:23 AM
                0 responses
                3 views
                0 likes
                Last Post GLFX005
                by GLFX005
                 
                Started by XXtrader, Yesterday, 11:30 PM
                2 responses
                12 views
                0 likes
                Last Post XXtrader  
                Working...
                X