Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug: "Set Default For <StrategyName>" in Backtest Form breaks on custom strategies

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

    Bug: "Set Default For <StrategyName>" in Backtest Form breaks on custom strategies

    Hello,

    I discovered a bug in the NT 7 Beta 4 Strategy Analyzer's "Backtest" Properties Form. When I right click on the label of a field like "Slippage" or "Fill type" and choose "Set Default For <My StrategyName>", an exception is thrown.

    Extra Info:

    All my Strategies inherit from my own base class, which inherits from NinjaTrader's Strategy class, like this:

    // here is my base class' declaration
    publicclass SubsystemBase : Strategy

    // here is an example of my actual Strategy's declarations
    publicclass MyStrategyClassNameGoesHere : SubsystemBase

    The exception is thrown both when I take this User Interface Action with my strategy base class in the "Backtest" form and when I try it for my actual strategy child class.

    The trace file shows the following information:

    2009-11-13 16:55:41:706 Setting ATI...
    2009-11-13 16:55:41:706 Starting messages timer...
    2009-11-13 16:55:41:706 Starting news timer...
    2009-11-13 16:55:41:706 Activating hot keys
    2009-11-13 16:55:41:706 ApplicationStart done, took 10.0 secs
    2009-11-13 16:56:34:628 in OnUnhandledThreadException
    2009-11-13 16:56:34:628 ********* exception trapped *********
    2009-11-13 16:56:34:628 There was an error reflecting type 'NinjaTrader.Strategy.SubsystemBase'.
    2009-11-13 16:56:34:628 at System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
    at System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, RecursionLimiter limiter)
    at System.Xml.Serialization.XmlReflectionImporter.Imp ortElement(TypeModel model, XmlRootAttribute root, String defaultNamespace, RecursionLimiter limiter)
    at System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace)
    at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
    at System.Xml.Serialization.XmlSerializer..ctor(Type type)
    at NinjaTrader.Cbi.XmlSerializerDictionary.get_Item(T ype type)
    at NinjaTrader.Cbi.Serializer.Serialize()
    at NinjaTrader.Strategy.StrategyBase.SetDefault()
    at NinjaTrader.Strategy.StrategyAnalyzer.OnSetDefault (Object sender, EventArgs e)
    at System.Windows.Forms.ToolStripItem.RaiseEvent(Obje ct key, EventArgs e)
    at System.Windows.Forms.ToolStripMenuItem.OnClick(Eve ntArgs e)
    at System.Windows.Forms.ToolStripItem.HandleClick(Eve ntArgs e)
    at System.Windows.Forms.ToolStripItem.HandleMouseUp(M ouseEventArgs e)
    at System.Windows.Forms.ToolStripItem.FireEventIntera ctive(EventArgs e, ToolStripItemEventType met)
    at System.Windows.Forms.ToolStripItem.FireEvent(Event Args e, ToolStripItemEventType met)
    at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEven tArgs mea)
    at System.Windows.Forms.ToolStripDropDown.OnMouseUp(M ouseEventArgs mea)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
    at System.Windows.Forms.ToolStrip.WndProc(Message& m)
    at System.Windows.Forms.ToolStripDropDown.WndProc(Mes sage& m)
    at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    #2
    >> All my Strategies inherit from my own base class,
    This is not supported. Please try to reproduce the issue on SampleMaCrossOver and let us know if you can reproduce.

    Comment


      #3
      NinjaTrader_Dierk,

      Thanks for the quick reply. No problem. I understand that NinjaTrader can't support all advanced applications of NinjaTrade such as my own, but I thought you should know about the problem I experienced anyway.

      ChiTrader2000

      Comment


        #4
        My strategies all inherit form a base class as well - I hope this eventually get some attention.

        Comment


          #5
          I cannot confirm!
          My Strategies also inherit from several classes , but finally also from Strategy.

          I tried to reproduce your error in the Backtest Form, but I cannot find an error.

          For me everything works fine.

          Andreas

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          601 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          347 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          559 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          558 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X