Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with Backtesting in different time zones

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

    Issue with Backtesting in different time zones

    Hello,

    A group of us have developed an automated trading system in Ninja. It only takes trader during the following times:
    10 AM EST to 11:45 AM EST
    and
    13:30 PM EST and 15:30 PM EST.

    Each of us runs it on a different time zone. What we have done is added parameters for each of these times, and we enter these parameters as they should be in each of our time zones. ie, for example, my friend in Las Vegas (his PC time is 3 hours behind EST), enters the following:
    7:00 AM to 8:45 AM
    and
    10:30 AM to 12:30 PM
    I myself am in London my PC time is 5 hrs ahead of EST. I enter the following times:
    15:00 PM to 16:45 PM
    and
    18:30 PM to 20:30 PM

    All this works perfectly when we're live, and we're perfectly synchronized, and take our trades together, and our systems stop taking trades at the same time.

    the problem we're having is when back-testing using Strategy Analyzer. We're getting different results.

    It looks like it's related to the time zones and the data. When we remove the time restrictions, and trade 24x7, our backtesting results match exactly.

    Can you please advise on how we can get the time restrictions sorted so our back testing results match?

    Thanks!

    #2
    Use the same time settings you are using in real-time. Data is timestamped by your local PC clock.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi there, thanks for the quick reply.

      I should have clarified that we are indeed using the same respective times that we use when live.

      I do understand that live data is timestamped with the PC clock time. But how is backtesting data timestamped? ie, when backtesting, if i receive a price for 1 hr ago, does the system know to timestamp it with the correct time by substracting 1 hour from the current PC time ?

      Comment


        #4
        Data is timestamped the same. I suggest you guys just check your charts and see what the starting timestamp of a session is for the both of you. Then you can proceed from there and make the adjustments needed to sync up.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hi there,

          I'm not sure I follow. We're backtesting for 1 month. do you mean when we test it now, all the data gets the current time as timestamp?
          When you say timestamp, are you referring to the time from the time&sales? sorry, i am a bit confused on that point. i assume when the data is downloaded (from Zenfire in this case), there is some sort of time attached to each data point by Zenfire. When Ninja is live, does it discard this time, and stamp the PC time as timestamp? if so, the same procedure cannot obviously be followed when downloading past data. In this case, I'd guess the timestamp on the data itself will have to be used. If so, how are differnt timezones handled? for eg, if the data has GMT, how is it converted to local time?

          Also, I'm not sure I follow the second suggestion about checking our charts and see what the starting timestamp of a session is. We don't have any problem when live, when we actually look at our charts. The problem is only when using Strategy Analyzer - and when we run it, we don't open any charts at all.

          Comment


            #6
            Do this:

            Run your backtest with 24 hr setting. Go to the Chart tab on the Strategy Analyzer. Press Ctrl + D to bring up the data box. Mouse over the first bar of any session and then look for the time field. That is the timestamp of that bar. Do this on your friends machine for the exact same bar. Then you guys will know the differential between your two machines and the time offset you need to introduce to backtest on the same time frame.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Jimmyk, 01-26-2018, 05:19 AM
            6 responses
            835 views
            0 likes
            Last Post emuns
            by emuns
             
            Started by jxs_xrj, 01-12-2020, 09:49 AM
            6 responses
            3,291 views
            1 like
            Last Post jgualdronc  
            Started by Touch-Ups, Today, 10:36 AM
            0 responses
            11 views
            0 likes
            Last Post Touch-Ups  
            Started by geddyisodin, 04-25-2024, 05:20 AM
            11 responses
            62 views
            0 likes
            Last Post halgo_boulder  
            Started by Option Whisperer, Today, 09:55 AM
            0 responses
            9 views
            0 likes
            Last Post Option Whisperer  
            Working...
            X