Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

setting Exchange time or Local Time

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

    #16
    Hi Klaus, thanks for your reply.

    I'm not seeing any issues when I test. This time zone material can get quite confusing so maybe I'm not understanding the issue. In your original post, you were saying the problem was there was an off by one error in your script. I tested with and without using ToLocalTime() and I was in the correct time zone regardless of EU going into DST later than the US.
    Chris L.NinjaTrader Customer Service

    Comment


      #17
      Hi Chris,
      yes, timezone issue are very confusing. That is why I wanted to use ToLocalTime(). I just removed the ToLocalTime() and everything is working now.
      I have the feeling that the issue with ToLocalTime() come due to my german settings of the windows server. But I couldn't figure out which once.
      Everything is fine now.
      Thanks very much for your help. I appreciate it very much!
      Klaus

      Comment


        #18
        I have similar issue and would like to propose a solution.

        I am wanting to trade multiple instruments, these span several timezones. I am using the trade performance report to check my results for trading. Because of timezones and overlapping trading days, there will be the case that most markets will go over 2 days in ones local timezone. It makes separating out the trades for a single day impossible, unless you download the data and then reset the DB after the last market for the Day which is the US market for most of us, however you would lose all those historical trades.

        The solution is to convert all the trades from the exchange time to your own local time.

        In order to achieve this we need to perform the calculation for any market traded.

        As NT is a database structure and has all the necessary reference data this should be achievable.

        Within the Instrument Data you have associated the Instrument with an exchange (see image attached)

        Within the trading hours Data you have the exchange as also specify its timezone UTC (see image attached)

        From that information it would be fairly easy to simply stamp all the data with exchange date and time, this could then be used throughout the platform for charts, reports etc.

        I'd like to formally ask for this as an enhancement to NT8, a global setting, either user local date/time or exchange date/time
        Attached Files
        Last edited by edstar; 06-01-2020, 07:03 PM.

        Comment


          #19
          Another alternative would be to have not just a filter selection on date in the performance report but also time, then a user could set their own period of interest.

          For me I would set it from 11am (today) to 6am (tomorrow). This might be a quicker, easier fix

          Comment


            #20
            Hi edstar, thanks for your post.

            The bar timestamps are already coming from your broker's time. They are converted into the timezone you have set in the options menu. At the end of this thread was the use of ToLocalTime(), which is not needed because NinjaTrader already converts the time stamp. Could you give an example of the issue you are seeing?

            I look forward to hearing from you.
            Chris L.NinjaTrader Customer Service

            Comment


              #21
              So what I need is to be able to use the exchanges timestamp to align all trades to the same day, consider the following instruments

              HSI (Hong Kong Index future) Timezone UTC+ 8
              FDAX (German Index Future) Timezone UTC+ 1
              ES ( US Index Future) Timezone UTC - 6

              I am in Melbourne, Australia Timezone UTC + 10

              The Trading Hours in my local time for these markets are

              HK Market 11:15am today to 03:00am the next day
              German Market 4pm today to 6:00am the next day
              US Market 11:30pm today to 6:00am the next day


              Take the HK market, when the next day starts, trades from 12 midnight to 3am Day 1 will get mixed in with trades from 11:15am to Midnight the next day based on my local time date selection

              As you can see all these markets span over 2 days in my local time but if we use the exchange time stamps they will all align to 1 single day, if we can get the exchange time time stamp as an option to be able to select on then there will be no overlap of dates.

              It becomes impossible to separate consecutive days trades in the trade performance report unless we get the exchange time stamp as an option or the ability to query the data with not just a date but a timestamp option as well.

              I hope you appreciate that there are many different users trading different instruments in different timezones and we need a robust solution to cater for everyone.

              As you've already mentioned the raw data is sent from the broker who would have the exchange time this should be a feasible option to be able to set in the DB which a user wants to use.

              Many thanks

              Comment


                #22
                I just saw this in the release notes for 8.0.22.1
                14425 Fixed Trade Performance Trade Performance window date was based on PC time zone, not NinjaTrader time zone
                I wonder if this might fix what I need ? What do you mean by NinjaTrader timezone ? Would this be a centralized timezone which would then align trades to the same day per my email above ?

                Comment


                  #23
                  Hi edstar, thanks for your reply.

                  The NinjaTrader time zone is configurable through Tools>Options>General>Time Zone. All bar time stamps that come into the platform will be converted to whatever this is set to. If you want the exchange time stamps just set this to your exchange time zone. This is set to your computer's time zone by default.

                  Please let me know if I can assist any further.
                  Chris L.NinjaTrader Customer Service

                  Comment


                    #24
                    Ok so after some research I've worked out the answer. A reminder of my problem, I am trading 3 instruments which span Asia, Europe and the US timezones.

                    I wanted to get the date to line up for all 3 timezones so that any trade conducted in a 24 hour cycle would report to the same date in the trade performance report.

                    The answer is to set the timezone in NinjaTrader to UTC+0 which makes sense as all our timezones use UTC as the reference point.

                    I hope this is of use to anyone else in the same situation.

                    Comment


                      #25
                      Hi all

                      I have faced the same problem. I am creating a strategy backtest to use in diferent instrements from diferent time zones. to simplify this I am going to speak about ES and FDAX with UTC-6 and UTC+1. This strategy uses open session time and close session time as reference.

                      The problem is how to manage time(hour),as example I show a code to cancel orders no filled 1 hour before close market but the time manage by strategy is local time, as my local time is UTC+1 I have no problem with FDAX but I found problems with ES due to saving time change is not done at same time in Europe and EEUU and during thse days my orders are canceled 1 hour before I want to do it. In the rest of time I only have to define the time base on my local time.

                      My questions is

                      Is there any way to use trading hours defined in the strategy as strategy/bars time for each strategy to avoid problems with saving change time? I cannot change by tools my time becuase I will use both strategies at same time and in this case one of them no wok properly. I mean i want to get the instrument time when I print Time[0].


                      In FADX strategy I would like to get this code:

                      if (ToTime(Time[0]) > 210000 &&
                      (Position.MarketPosition == MarketPosition.Flat) )​


                      In ES strategy I would like to get this code, using 140000 as 1 hour previous market close while my local time is UTC+1

                      if (ToTime(Time[0]) > 140000 &&
                      (Position.MarketPosition == MarketPosition.Flat) )​

                      Click image for larger version

Name:	image.png
Views:	419
Size:	9.7 KB
ID:	1237699


                      Regards

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by mattbsea, Today, 05:44 PM
                      0 responses
                      5 views
                      0 likes
                      Last Post mattbsea  
                      Started by RideMe, 04-07-2024, 04:54 PM
                      6 responses
                      31 views
                      0 likes
                      Last Post RideMe
                      by RideMe
                       
                      Started by tkaboris, Today, 05:13 PM
                      0 responses
                      2 views
                      0 likes
                      Last Post tkaboris  
                      Started by GussJ, 03-04-2020, 03:11 PM
                      16 responses
                      3,282 views
                      0 likes
                      Last Post Leafcutter  
                      Started by WHICKED, Today, 12:45 PM
                      2 responses
                      20 views
                      0 likes
                      Last Post WHICKED
                      by WHICKED
                       
                      Working...
                      X