Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DayOfWeek property crushes NT if run strategy in Strategy Analyser (on some PCs)

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

    DayOfWeek property crushes NT if run strategy in Strategy Analyser (on some PCs)

    Hello.
    I found the very strange behaviour of DayOfWeek property.
    When run the strategy with property of this type twice - it cruses NT.
    I tested on 4 PCs: two crushed, another two worked fine.
    Fully qualified name like System.DayOfWeek not helps.

    What can be the reason?

    PHP Code:
    namespace NinjaTrader.NinjaScript.Strategies.NT_Forum_Strategies
    {
        public class sDayOfWeed_Sa_Crush : Strategy
        {        
            protected override void OnStateChange()
            {            
            }    
    
            [NinjaScriptProperty]
            [Display(Name="Period",    GroupName="Parameters", Order=1)]
            public
                DayOfWeek  
                Period    
                { get; set; }        
        }
    } 
    

    The video (0:20): https://screencast-o-matic.com/watch/cYeZIgyuSn


    There are 2 error messages in log:

    1. Unhandled exception: Object reference not set to an instance of an object.

    2. Unable to create instance of NinjaScript 'sDayOfWeed_Sa_Crush'. Most likely either the implementation no longer exists, there is no default constructor defined, the default constructor does not work correctly, or the 'OnStateChange' implementation for State=SetDefaults is flawed: System.NullReferenceException: Object reference not set to an instance of an object.

    Trace file:

    2020-03-24 16:05:23:570 Starting server message polling timer with interval 3600 seconds...
    2020-03-24 16:06:59:018 ERROR: Unable to create instance of NinjaScript 'sDayOfWeed_Sa_Crush'. Most likely either the implementation no longer exists, there is no default constructor defined, the default constructor does not work correctly, or the 'OnStateChange' implementation for State=SetDefaults is flawed: System.NullReferenceException: Object reference not set to an instance of an object. at NinjaTrader.NinjaScript.Parameter.CopyTo(Parameter parameter) at NinjaTrader.NinjaScript.Parameter.Clone() at NinjaTrader.NinjaScript.StrategyBase.CopyTo(NinjaS cript ninjaScript) at NinjaTrader.Gui.NinjaScript.StrategyRenderBase.Cop yTo(NinjaScript ninjaScript) at NinjaTrader.NinjaScript.NinjaScript.Clone()
    2020-03-24 16:06:59:027 *************** unhandled exception trapped ***************
    2020-03-24 16:06:59:027 Object reference not set to an instance of an object.
    2020-03-24 16:06:59:028 System.NullReferenceException: Object reference not set to an instance of an object.
    at NinjaTrader.NinjaScript.Parameter.CopyTo(Parameter parameter)
    at NinjaTrader.Gui.NinjaScript.StrategyTemplate.Apply StrategyParameters(StrategyBase template, StrategyBase target, Boolean allParams)
    at NinjaTrader.Gui.NinjaScript.StrategyAnalyzer.Strat egyAnalyzerViewModel.<>c__DisplayClass89_0.<OnRunC ompleted>g__Done|1(Boolean playSound)
    at NinjaTrader.Gui.NinjaScript.StrategyAnalyzer.Strat egyAnalyzerViewModel.<>c__DisplayClass89_0.<OnRunC ompleted>b__0()
    at System.Windows.Threading.DispatcherOperation.Invok eDelegateCore()
    at System.Windows.Threading.DispatcherOperation.Invok eImpl()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatch Info.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.Handle NonSuccessAndDebuggerNotification(Task task)
    at System.Windows.Threading.DispatcherOperation.Wait( TimeSpan timeout)
    at System.Windows.Threading.Dispatcher.InvokeImpl(Dis patcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout)
    at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
    at System.Windows.Threading.Dispatcher.Invoke(Action callback)
    at NinjaTrader.Gui.Tools.DispatcherHelper.CheckUiInvo ke(Dispatcher uiDispatcher, Action action, Boolean async)
    at NinjaTrader.Gui.NinjaScript.StrategyAnalyzer.Strat egyAnalyzerViewModel.DispatchToOwner(Action action)
    at NinjaTrader.Gui.NinjaScript.StrategyAnalyzer.Strat egyAnalyzerViewModel.OnRunCompleted(StrategyAnalyz erTabControl tab, LogSourceFileInfo nsLogSource, RunResult result)
    at NinjaTrader.Gui.NinjaScript.StrategyAnalyzer.Strat egyAnalyzerViewModel.<>c__DisplayClass88_0.<OnRun> b__1(RunResult r)
    at NinjaTrader.Gui.NinjaScript.StrategyAnalyzer.Strat egyRunner.<>c__DisplayClass7_0.<RunStrategyAsync>b __0(Object o)
    at System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.QueueUserWorkItemCallback.System. Threading.IThreadPoolWorkItem.ExecuteWorkItem()
    at System.Threading.ThreadPoolWorkQueue.Dispatch()


    Log:

    2020-03-24 16:06:59:018|3|4|Unable to create instance of NinjaScript 'sDayOfWeed_Sa_Crush'. Most likely either the implementation no longer exists, there is no default constructor defined, the default constructor does not work correctly, or the 'OnStateChange' implementation for State=SetDefaults is flawed: System.NullReferenceException: Object reference not set to an instance of an object. at NinjaTrader.NinjaScript.Parameter.CopyTo(Parameter parameter) at NinjaTrader.NinjaScript.Parameter.Clone() at NinjaTrader.NinjaScript.StrategyBase.CopyTo(NinjaS cript ninjaScript) at NinjaTrader.Gui.NinjaScript.StrategyRenderBase.Cop yTo(NinjaScript ninjaScript) at NinjaTrader.NinjaScript.NinjaScript.Clone()
    2020-03-24 16:06:59:028|0|4|Unhandled exception: Object reference not set to an instance of an object.

    Attached Files
    Last edited by fx.practic; 03-24-2020, 08:18 AM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    Thanks for your post.

    I have been able to reproduce, and I have reported the matter internally.

    I will follow up as more information becomes available.

    Comment


      #3
      Thank you, Jim
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        I don't have this issue

        This empty strategy doesn't crush NT

        Maybe this is a 1-April day joke?

        Comment


          #5
          0-day joke.
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            Hello,

            The issue has been recognized and assigned the ticket ID NTEIGHT-14388. The number for this ID can be found in the Release Notes page of the Help Guide when a new release becomes available with a fix.

            We cannot offer an ETA on release schedules, but you may reference the Release Notes here - https://ninjatrader.com/support/help...ease_notes.htm

            We look forward to assisting.

            Comment


              #7
              Thank you, Jim!
              I am highly appreciated prompt reaction.
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              64 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              139 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              75 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              45 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              50 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X