Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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    
                
    getset; }        
        }


    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.
    JimNinjaTrader Customer Service

    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.
            JimNinjaTrader Customer Service

            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 helpwanted, Today, 03:06 AM
              1 response
              7 views
              0 likes
              Last Post sarafuenonly123  
              Started by Brevo, Today, 01:45 AM
              0 responses
              7 views
              0 likes
              Last Post Brevo
              by Brevo
               
              Started by aussugardefender, Today, 01:07 AM
              0 responses
              5 views
              0 likes
              Last Post aussugardefender  
              Started by pvincent, 06-23-2022, 12:53 PM
              14 responses
              242 views
              0 likes
              Last Post Nyman
              by Nyman
               
              Started by TraderG23, 12-08-2023, 07:56 AM
              9 responses
              385 views
              1 like
              Last Post Gavini
              by Gavini
               
              Working...
              X