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.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
setting Exchange time or Local Time
Collapse
X
-
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
-
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
- Likes 1
Comment
-
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
Last edited by edstar; 06-01-2020, 07:03 PM.
Comment
-
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
-
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
-
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
-
I just saw this in the release notes for 8.0.22.1
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 ?14425 Fixed Trade Performance Trade Performance window date was based on PC time zone, not NinjaTrader time zone
Comment
-
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
-
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
-
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) )
Regards
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by spottysallrite, Today, 11:31 AM
|
1 response
2 views
0 likes
|
Last Post Today, 11:43 AM | ||
Started by johnMoss, 03-04-2024, 01:53 PM
|
2 responses
31 views
0 likes
|
Last Post
by Overnhou
Today, 11:21 AM
|
||
Started by Padan, Today, 02:02 AM
|
5 responses
17 views
0 likes
|
Last Post Today, 11:14 AM | ||
Started by Lele2k24, Yesterday, 11:24 AM
|
8 responses
28 views
0 likes
|
Last Post
by Lele2k24
Today, 11:00 AM
|
||
Started by kramnor2001, Yesterday, 02:30 PM
|
4 responses
24 views
0 likes
|
Last Post
by bltdavid
Today, 10:44 AM
|
Comment