Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MultiTimeFrame and imported historic tick data

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

    MultiTimeFrame and imported historic tick data

    Is there a setting to enable multi time frame back testing?

    I have imported 8 years worth of tick data for $AUDUSD both Bid and Ask and verified that the data is valid by opening a chart for different time frames example 1/1/2010 to 3/31/2010 and everything displays fine. I have changed the setting in the Global Instrument Settings to "Do not merge".

    Now, when I run a backtest of SampleMACrossOver Strategy for the period 1/1/2010-3/3/2010 it runs fine. I can run the starategy on ticks,various minutes etc.

    But when I select the SampleMultiTimeFrame as the strategy for my backtest for the same period it does not work.

    I made sure that I am running on Bid/Ask data and not using Last.
    I also created a simple strategy that prints the bar time for every new Bar. This works when a there are no Add() calls in the Initialize() function.
    As soon as I add a simple statement like below to the Initialize() it stops working.
    Add(PeriodType.Minute, 5);

    The OnBarUpdate() never gets called for strategies with multiple timeframes ont he same instrument when working with imported historic tick data.

    Any help would be greatly appreciated.

    #2
    suryafx,

    Did you start a similar thread here with a different username?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I looked at the other thread too. Looks similar but my issue is very specific to the MutliTimeFrame.

      I am able to back test both the timeframes individually using the SampleMACross Over. But when I combine them by using Add() I am not seeing any trades. I thought It is an issue with number of bars etc. I tried an entire year worth of data too.
      1/1/2010 to 12/31/2010.
      As above they work fine independently but when added to the same strategy, it doesn't work.

      I have no issues running this for the last 3-6 months ie. 10/1/2011 to 3/1/2012 . The issues only shows up with imported historic data beyond the broker provided data.
      Hence I disabled the merge by selecting "Do Not Merge" and also by verifying that the data is valid and all the timeframes exist for that historic range.

      Assuming that the data is valid (since I can run and open charts for the time period) and the strategy is not doing anything complicated, just Print() on OnBarUpdate(), what could be the issue?
      Last edited by suryafx; 03-12-2012, 11:12 AM.

      Comment


        #4
        I see. Thanks for the reply. If your issue is specific to SampleMultitimeFrame strategy, I would look at your minute data availability. When you import data, there is a box to check "generate minute bars form imported tick data". This needs to be checked in order to have the minute data.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I have done the steps as per your suggestion. Still have the issue.

          I have deleted and reimported the tick data with Generate Minute Bars and Generate Day Bars checked.

          I opened 1, 5 and 15 minute ask charts for the time span 1/1/2010 and 6/1/2010.
          No data issues and the charts display fine

          To isolate the issue to multi time frame first I ran the SampleMACross strategy which uses only one timeframe for the same above time span. I ran this three times with 1, 5, 15 minutes for the above historic timeperiod. Everything works as expected. and the strategy runs and places orders, No issues,

          Now, at this point I strongly believe that there are no data issues and importing issues.

          To reproduce the multi timeframe issue, I change the strategy to "SampleMultiTimeFrame" and run with the same time span as above. The strategy places no orders. When I set a break point, in Visual Studio for the above strategy, the OnBarUpdate() never gets called.

          The issue appears to be only with the adding multiple timeframes to the chart.



          I can provide the sample data files I
          am using in case you want to use the same data to reproduce the issue.
          Last edited by suryafx; 03-12-2012, 09:19 PM.

          Comment


            #6
            Finally here is the solution:

            Unlike the sample code and the documentation, the Add() needs to be called with the full set of parameters.

            Add(PeriodType.Minute, 1); does not work for some reason.

            The line below works.

            Add(Instrument.FullName, PeriodType.Minute, 1, MarketDataType.Ask); // For intrabar order generation

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            649 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            576 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X