Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot backtest hand coded strategy

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

    Cannot backtest hand coded strategy

    Good morning,

    I have developed a strategy without the Wizard and I cannot Backtest it.

    When I select my strategy in the ComboBox, it keep the sample strategy selected.

    Why ?

    Regards,
    Steven

    PS : my code compiles well
    Attached Files

    #2
    Steven, would you mind posting the code for the strategy that won't load in the combo box? You should be able to backtest and/or optimize all strategies without a problem.

    If that isn't possible, could you please list the steps that reproduce this issue?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Here is the code :

      Code:
      #region Using declarations
      using System;
      using System.ComponentModel;
      using System.Diagnostics;
      using System.Drawing;
      using System.Drawing.Drawing2D;
      using System.Xml.Serialization;
      using NinjaTrader.Cbi;
      using NinjaTrader.Data;
      using NinjaTrader.Indicator;
      using NinjaTrader.Gui.Chart;
      using NinjaTrader.Strategy;
      #endregion
      
      // This namespace holds all strategies and is required. Do not change it.
      namespace NinjaTrader.Strategy
      {
          /// <summary>
          /// Enter the description of your strategy here
          /// </summary>
          [Description("Enter the description of your strategy here")]
          public class MyCustomStrategy2 : Strategy
          {
              #region Variables
      		private const int OB_ZONE = 20;
      		private const int OS_ZONE = 75;
      		
              private bool _signalUT_Inf = false; //UT - 1
      		private bool _signalUT = false; //UT
      		private bool _signalUT_Sup = false; //UT + 1
      		private bool _isLong = false;
      				
      		private Bars _dsUT_Inf;
      		private Bars _dsUT; 
      		private Bars _dsUT_Sup; 
      		
      		private double _signalHigh;
      		
              // User defined variables (add any user defined variables below)
              #endregion
      
              /// <summary>
              /// This method is used to configure the strategy and is called once before any strategy method is called.
              /// </summary>
              protected override void Initialize()
              {
                  Add(PeriodType.Minute,2); //BarsArray[1]
      			Add(PeriodType.Minute,10); //BarsArray[2]
      			Add(PeriodType.Minute,60); //BarsArray[3]
      			
      			_dsUT_Inf = BarsArray[1];
      			_dsUT = BarsArray[2];
      			_dsUT_Sup = BarsArray[3];
      			
      			Add(SMA(5));
      			CalculateOnBarClose = false;
              }
      
              /// <summary>
              /// Called on each bar update event (incoming tick)
              /// </summary>
              protected override void OnBarUpdate()
              {
      			if(BarsInProgress != 0)
      				return;
      			
      			//Entry code
                                       //Exit code
      
      
              }
      
              #region Properties
              #endregion
          }
      }
      Thank you,
      Regards,
      Steven

      Comment


        #4
        Thanks Steven, but I'm not sure I follow what the issue is - I could compile it, select it to backtest it, but of course there no trade entry logic thus it's not producing any significant results...
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Thanks Steven, but I'm not sure I follow what the issue is - I could compile it, select it to backtest it, but of course there no trade entry logic thus it's not producing any significant results...
          Good morning Bertrand,

          The issue is that when I select my strategy for backtesting it, it keep the previous strategy selected et backtest the previous selected strategy.

          Should I get a live license for backtesting?

          Regards,
          Steven

          PS : I remove the logic because from the code

          Comment


            #6
            Thanks for clarifying Steven, is this on 6.5.1000.14? If not please upgrade via Help > Download Site and retry.

            If you're on the latest NT, I would recommend a fresh .NET install (uninstall all downto 1.0 / 1.1 and then just reinstall the latest 3.5).
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              Thanks for clarifying Steven, is this on 6.5.1000.14? If not please upgrade via Help > Download Site and retry.

              If you're on the latest NT, I would recommend a fresh .NET install (uninstall all downto 1.0 / 1.1 and then just reinstall the latest 3.5).
              I have .NET 4 installed. Is that a problem ?

              I will try what you said and keep you informed.

              Thank you,
              Steven

              Comment


                #8
                No, shouldn't be Steven, as it would incorporate prior version, but could be corrupted as well so I would still go with a fresh install of this after you've uninstalled all downto the 1.1 release.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Jltarrau, Today, 05:57 AM
                0 responses
                1 view
                0 likes
                Last Post Jltarrau  
                Started by f.saeidi, Today, 05:56 AM
                0 responses
                2 views
                0 likes
                Last Post f.saeidi  
                Started by Stanfillirenfro, Yesterday, 09:19 AM
                7 responses
                51 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by TraderCro, 04-12-2024, 11:36 AM
                4 responses
                70 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Mindset, Yesterday, 02:04 AM
                1 response
                15 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X