Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Problem synchronizing FX data to GMT 00?

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

    Problem synchronizing FX data to GMT 00?

    Howdy.

    I've had a problem for quite some time, and that is with getting the FX data that I have to be set to Universal time.

    My machine runs on CST, Chicago or UTC-6 hours. Changing my machine time to GMT would really be inconvenient.

    What I am wanting is to use my script, with my session manager to be able to have a common start time. I am wanting that start time to be around the start of Asia, or 1600 Central Standard time, but this jumps across two sessions. See picture attached labeled, "Date Problem."

    Currently my session template looks like the pic attached labeled "Session Template."

    I have tried several things.

    1) Initially, I would use "Bars.FirstBarOfSession." I would initialize the date to a string:
    Code:
    currentDate = Time[0].AddDays(1);
    This would add a day to the First bar of Session, which would sync the date to universal, and then simply subtract any date/time I need from that bar that occurred on the first bar, giving me the elapsed time.


    2)Next I would use:
    Code:
    currentDate = Time[0].ToUniversalTime();
    This works most of the time, by adjusting the session template so that 00GMT matches up with the session template I create. The problem occurs with what appears to be the daylight savings issue. Where for the first half of the year of data I look at, it works fine, but the 2nd half seems to require a different template.

    Is there a simple way of solving this issue that I am unaware of?
    Attached Files
    Last edited by forrestang; 10-03-2013, 10:39 PM.

    #2
    You have not explained, why you need to sync the date to universal. Universal time does not take into account the daylight savings schedules, so it cannot be used for any FOREX markets. You also need to take into account that Tokyo has no DST schedule and that UK and US schedules use different dates to switch from wintertime to summertime and back.

    The FOREX trading day starts at 5:00 PM EST. This is the market close of New York, and all price action occuring after that date is assumed to be linked to FOREX markets in Wellington, Sydney, Tokyo and Hong Kong. I do not understand, why you would like to start your trading day on 7:00 PM CT, which is just one hour later.

    The Tokyo market opens around 9:00 AM TST, which is 8:00 PM EST in summer and 7:00 PM EST in winter. If you wish to build a session template that catches the start of the Tokyo session, then you need to set it up in Tokyo Standard Time to avoid that it shifts with the US daylight savings schedule. However, you would probably be the only trader in the world, who uses such a template.

    There is no date problem, as what you call two sessions does not exist. I have the impression that you try to divide the trading day into two sessions by using your local date. However, the date of the FOREX session is determined by the date of the trading day. For the trading day, you can use

    -> 5:00 PM EST to 5:00 PM EST
    -> alternatively 12:00 AM GMT to 12:00 AM GMT

    The first one would be equivalent to a session from 10:00 PM GMT to 10:00 PM GMT during 49 weeks of the year - but pay attention to the second two weeks in march and the week of Halloween, where it will be 9:00 PM GMT to 9:00 PM GMT.

    Comment


      #3
      I probably did a bad job explaining what I want.

      So basically, I don't really use the charts anymore, all of my data is in tables now. I just pull info from the charts to put into my tables. One important thing is to be able to time stamp all my metrics. And I'm currently doing it in a sort of round-about about way, by using Bars.FirstBarOfSession, and adding minutes after that.


      So essentially, I want to define a session template.... in my case at the start of the Asia/Sydney session/end of NY, and have any metric I pull from that session that I define, to have the same date, as that's the trading session I use. Hence why I was using .ToUniversalTime().

      The reason I was using UTC, or other the hour later time, was just an attempt to accomplish this. I've been doing this for a while, which usually requires me to manually scrub my data which is rather time consuming.

      Just to be clear, I'm not saying there is a problem with NT or it's dates, its just an issue I have with what I'm personally trying to accomplish with regards to capturing my data. BUt you are correct in the sense that I am wanting to divide my local machine time into two dates, or more aptly 'shift' it by some hours.

      If there is no obvious answer, that's ok I suppose, its just been something that I've been trying to solve for a while now.
      Attached Files

      Comment


        #4
        With NinjaTrader it is impossible to create a template

        - which starts at the beginning of the Tokyo session (at 8:00 AM or 9:00 AM Tokyo time)
        - and which ends at the end of the US session (5:00 PM EST)

        The reason is that the session template can only use a single time zone as a reference. However Tokyo time and New York time do not move in parallel, as Tokyo does not observe daylight saving time in summer, but New York does. Therefore you would need to create a summer template and a winter template.

        Also if you create such template, all price action between the New York close and the Tokyo open would be excluded from your chart.

        However, it is possible to translate the Tokyo open time to Universal time or EST within an indicator. For example, I have coded a FOREX session indicator

        -> which shows the Tokyo open (expressed in Tokyo Standard Time)
        -> which shows the New York close (expressed in Eastern Standard Time)

        The duration of the combined Tokyo, London and New York session changes with the switch from summertime to wintertime and vice versa. The indicator can be found here:

        The best futures trading community on the planet: futures trading, market news, trading charts, trading platforms, trading strategies
        Attached Files

        Comment


          #5
          As I mentioned, I'm not too worried about what's on the charts, just being able to pull data from a chart to put into a table, for that I would like to find a consistent way to pull the dates from the sessions I plot.

          So not being able to create a template with the times I desire on the actual charts doesn't concern me much.

          I will give your script a look to see if I can glean how I might be able to put something together to create the dating format I desire.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by PaulMohn, Today, 03:49 AM
          0 responses
          4 views
          0 likes
          Last Post PaulMohn  
          Started by inanazsocial, Today, 01:15 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by rocketman7, Today, 02:12 AM
          0 responses
          10 views
          0 likes
          Last Post rocketman7  
          Started by dustydbayer, Today, 01:59 AM
          0 responses
          2 views
          0 likes
          Last Post dustydbayer  
          Started by trilliantrader, 04-18-2024, 08:16 AM
          5 responses
          23 views
          0 likes
          Last Post trilliantrader  
          Working...
          X