• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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, 05: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 lavalampmj, Today, 05:25 PM
                0 responses
                1 view
                0 likes
                Last Post lavalampmj  
                Started by Antares66, Today, 05:19 PM
                0 responses
                2 views
                0 likes
                Last Post Antares66  
                Started by jmneto, Today, 05:18 PM
                0 responses
                2 views
                0 likes
                Last Post jmneto
                by jmneto
                 
                Started by Bobbyj78, Today, 02:21 PM
                2 responses
                12 views
                0 likes
                Last Post bltdavid  
                Started by EnveousColnago, Today, 02:10 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Ariana  
                Working...
                X