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 edward_steve12, Today, 03:23 AM
            1 response
            3 views
            0 likes
            Last Post Emma1
            by Emma1
             
            Started by joseph_kuruvilla12, Today, 01:01 AM
            1 response
            7 views
            0 likes
            Last Post Emma1
            by Emma1
             
            Started by samish18, Today, 04:01 AM
            1 response
            4 views
            0 likes
            Last Post Emma1
            by Emma1
             
            Started by greenberet, Today, 04:05 AM
            0 responses
            2 views
            0 likes
            Last Post greenberet  
            Started by edward_steve12, Today, 02:25 AM
            0 responses
            7 views
            0 likes
            Last Post edward_steve12  
            Working...
            X