Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting for 18 months back with a multi time period not working

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

    Backtesting for 18 months back with a multi time period not working

    Hi,
    I am backtesting one instrument for a 18 month period.

    I use 10 min bars as primary and 1 min as secondary.

    Strange that when I do the backtest, though I select 1st Jan 2013 as beginning month, I see data starting from 1st Oct 2013. Practically 10 months are left out.

    When I specifically select 1st Jan 2013 - 30th Oct 2013, no data appears (blank with 0s in all results).

    Has anyone have any idea why this might be happening?

    I am using Kinetick real time subscription for historical data provider.

    #2
    Hello nikolaalx,

    Thanks for your post.

    What instrument (and expiry if applicable) have you selected?
    What is your Merge Policy set to? (Tools> Options>Data> MergePolicy)
    BrandonNinjaTrader Customer Service

    Comment


      #3
      I am testing FB .

      Merge policy is : MergeBackAdjusted

      Comment


        #4
        Hello nikolaalx,

        Thanks for your reply.

        Are you able to get results if you backtest the SampleMACrossover during this time?
        If you open a minute chart are you able to display bars during this time?
        BrandonNinjaTrader Customer Service

        Comment


          #5
          I am able to generate results and charts with single timeframe strategies.

          I am also able to generate partial results for that particular multi timeframe period strategy, however for those 10 months, they do not appear.

          I have tried to reload the historical data but to no avail.

          Comment


            #6
            Hello nikolaalx,

            Thanks for you reply.

            Can I clarify, currently does historical minute data during this period display if you open it in a chart or is this data missing and not able to be reloaded?
            BrandonNinjaTrader Customer Service

            Comment


              #7
              Yes I am able to load up a chart for the whole period (1min bars) just fine.

              I am also able to load a 10 min bars chart as well.

              Comment


                #8
                Hello nikolaalx,

                Thanks for your reply.

                I have tested a multi time frame strategy on my end to work during this time without issue.

                Please test the attached strategy and see if it works for you.

                To Import
                1. Download the strategy to your desktop, keep them in the compressed .zip file.
                2. From the Control Center window select the menu File> Utilities> Import NinjaScript
                3. Select the downloaded .zip file
                4. NinjaTrader will then confirm if the import has been successful.

                Critical - Specifically for some strategies, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'
                Attached Files
                BrandonNinjaTrader Customer Service

                Comment


                  #9
                  Missing action when Add(PeriodType.Day, 1)

                  Originally posted by nikolaalx View Post
                  Yes I am able to load up a chart for the whole period (1min bars) just fine.

                  I am also able to load a 10 min bars chart as well.
                  I am having exactly the same problem in differents time frames.
                  I backtested 15 minutes strategy since 01/01/2013 and after I Add(PeriodType.Day, 1); the strategy just forget the past before 09/08/2013. (dd/MM/yyy)
                  I have tried print together all info OnBarUpdate() and it just ignored the command before 09 August. I am not seeing where I get wrong.
                  Thanks for help in advance.

                  Comment


                    #10
                    Hello Marcelogais,

                    Thanks for your post.

                    What instrument (and expiry if applicable) have you selected?
                    What is your Merge Policy set to? (Tools> Options>Data> MergePolicy)
                    Are you able to get results if you backtest the SampleMACrossover during this time for minute data? How about for daily data?
                    BrandonNinjaTrader Customer Service

                    Comment


                      #11
                      I am testing to ES 09-14 Policy set to MergeBackAdjusted
                      My code
                      protected override void OnBarUpdate()
                      {
                      if (BarsInProgress !=0)
                      return;

                      Print(Time[0].ToString("dd/MM/yyyy") + "," + Time[0].ToString("HH:mm") + ", BarIndex0: " + CurrentBars[0] + ", BarIndex1: " + CurrentBars[1] +", EMA1: " + EMA(Ema1)[0] + ", EMA2: " + EMA(Ema2)[0]);
                      // Condition set 1
                      if (CrossAbove(EMA(Ema1), EMA(Ema2), 1))
                      {
                      Print(Time[0].ToString("dd/MM/yyyy") + "," + Time[0].ToString("HH:mm:ss") + EMA(Ema1)[0] + " XUp EMA");
                      ExitShort("ExS", "");

                      The first prints OnBarUpdated() are:
                      09/08/2013,17:00, BarIndex0: 3998, BarIndex1: 1, EMA1: 1664,12871106547, EMA2: 1664,99270500709
                      12/08/2013,10:45, BarIndex0: 3999, BarIndex1: 1, EMA1: 1663,86835551177, EMA2: 1664,85206995841
                      12/08/2013,11:00, BarIndex0: 4000, BarIndex1: 1, EMA1: 1663,61862671537, EMA2: 1664,71416568737
                      And they crossabove only
                      23/08/2013,14:15:001627,53600033757 XUp EMA

                      Backtesting SampleMACrossover for minute data it worked fine, but when I choose daily data It seemed to wait the same time for started backtesting.
                      I have notice the problem is when mixed daily and minutes.

                      Comment


                        #12
                        Hello Marcelogais,

                        Thanks for your reply.

                        Who are you connected to for data? This is displayed in the bottom left of the Control Center in green.
                        What From and To date are you testing?
                        BrandonNinjaTrader Customer Service

                        Comment


                          #13
                          Hello Brandon thanks for answer.
                          My data come from IB.
                          I usually backtest not logged, it is in my ninja data base, but before add 1 day data period it worked fine.
                          Have you notice my print BarIndex1 = currentbar[1]=1 it appear only 3398 bars after my 15 min running.
                          I am testing 01/01/2013 to 09/09/2014 (dd/MM/yyyy)

                          Comment


                            #14
                            Originally posted by Marcelogais View Post
                            Backtesting SampleMACrossover for minute data it worked fine, but when I choose daily data It seemed to wait the same time for started backtesting.
                            Hello Marcelogais,

                            Thanks for your reply.

                            If you are saying that you can not properly run the SampleMACrossover on daily data for this time period this is what will need to be resolved.

                            Please ensure you are running the most recent version of NinjaTrader and the required version of Traders Workstation.

                            To check what version of NinjaTrader you are running go to Help> About
                            To upgrade to NinjaTrader version 7.0.1000.25 please follow the link bellow.

                            Under Current User paste your license key.
                            You can locate your license key under Help> License key
                            Select Download NinjaTrader
                            Download Version 7.0.1000.25 (Current)
                            Before running the installer ensure NinjaTrader is closed.

                            To verify what version of Traders Workstation you currently have log into Traders Workstation

                            * Under Help go to About Traders Workstation...
                            * Scroll down and look for Build

                            You can download Traders Workstation 944.3 from the link below


                            Follow the steps in our Interactive Brokers Connection guide (linked below) to configure Traders Workstation 944.3



                            Once complete exit NinjaTrader and open the following directory in Windows
                            Documents\Ninjatrader 7\db\cache
                            Delete the contents within this folder
                            Next open Documents\Ninjatrader 7\db\Day
                            Delete the ES data within this folder

                            Start NinjaTrader and test the SampleMACrossover once again on daily data
                            BrandonNinjaTrader Customer Service

                            Comment


                              #15
                              If I delete the ES db from this directory I will not be allowed to download again so much data from IB, they say the historical request is too long.
                              I am using all updated application that you mentioned.
                              Last edited by Marcelogais; 09-12-2014, 02:44 PM. Reason: Missing text

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by andrewtrades, Today, 04:57 PM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by chbruno, Today, 04:10 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post chbruno
                              by chbruno
                               
                              Started by josh18955, 03-25-2023, 11:16 AM
                              6 responses
                              436 views
                              0 likes
                              Last Post Delerium  
                              Started by FAQtrader, Today, 03:35 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post FAQtrader  
                              Started by rocketman7, Today, 09:41 AM
                              5 responses
                              19 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Working...
                              X