Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
coping with daylight savings times in back testing and session templates
Collapse
X
-
thanks for this. You've prompted me to think of the best solution I believe. I hope this is of use to other trades.
My (quite) simple solution is to just modify my C# executible I created that converts my original data into format suitable for NT6/7 import. In this code you simply have some kind of lookup table that provides the offset in hours within certain date ranges. When you parse the input file to output, you add/subtract the relevant hours to fix your data.
You then import the data into NT and apply whatever session template you would like for your starting time of the day
hope this helps some others.
thanks
PolarBear
-
Originally posted by PolarBear View Post...How do you set it up to accomidate the above (different times of the year have offset start/end times)...
a) leave your trading computer in Chicago time CST (even though it's located somewhere else), so that the operating system will make the correct adjustments for daylight saving in Chicago, with the result that your data will always be correct relative to CST (I do this: I'm in Europe, but trade US markets ... my trading computers are all in EST)
b) convert your data to GMT (someone like the following could do this for you) tickmaster.webs.com
Leave a comment:
-
Hi PolarBear,
Unfortunately NinjaTrader does not provide for dynamic session templates. They're set once per bar series. For any time-sensitive parts of your strategy, you would need to custom code what you would like to happen. This sample can help work with DateTime objects:
Leave a comment:
-
thanks for the reply. The data isn't from a broker connection. The data is from very reputable high quality 1 minute cqg data. the data varies throughout the year depending on the daylight saving time, and the issue as described below, if you say want to have your daily bars matched up to something like the london open or similar, means there's again different times of the day where there's an issue.
How does the NT team suggest I approach this problem.
Ideally there should be some way to set the session template for the backtest run THROUGHOUT the backtest run.
So for example at a certain date (eg: at the end of the weekly session) i then change the session template, so for the next week the open/close times are correct.
From what I understand it you currently assign all dataseries added to the strategy as whatever the session template is defined as in the parameters for the backtest/optimisation.
Please advise.
thanks
Leave a comment:
-
PolarBear,
Generally historical data that is saved is time stamped to your local PC. The session templates simply limit the data that displays on your chart to be between certain times. It is generally recommended to keep your PC clock synced to some time service, like NIST to avoid issues.
Please let me know if I may assist further.
Leave a comment:
-
coping with daylight savings times in back testing and session templates
Hi,
I'm sure this is not an isolated problem that only I have, so hopefully this will be of use to many.
I have 1 minute fx data spanning back many years. The issue I have is that i want to represent my daily bars for testing in london time.
Typically you can just set the session template times for the appropriate timezone, however there's an issue:
london has daylight savings time some parts of the year, where you would need to offset the bar data by 1 hour.
Also, the data imported was from CQG (time reference Chicago time). The complication is then and different times of the year you need to offset one hour for the chicago daylight savings time also.
The result is at different dates in the year, my data needs to be shifted by 0, 1 or 2 hours.
From previous correspondance, the strategy backtest can be assigned the session template, so the daily bars constructed have the correct start/end time.
How do you set it up to accomidate the above (different times of the year have offset start/end times).
Note that the changes/shift in timezone occur over the weekend where FX is closed, so there is no issue of data overlap or an hour of data missing etc.
thanksTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by fx.practic, 10-15-2013, 12:53 AM
|
5 responses
5,403 views
0 likes
|
Last Post
by Bidder
Today, 12:22 AM
|
||
Started by Shai Samuel, 07-02-2022, 02:46 PM
|
4 responses
94 views
0 likes
|
Last Post
by Bidder
Today, 12:11 AM
|
||
Started by DJ888, Yesterday, 10:57 PM
|
0 responses
6 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Yesterday, 10:23 PM | ||
Started by Belfortbucks, Yesterday, 09:29 PM
|
0 responses
8 views
0 likes
|
Last Post
by Belfortbucks
Yesterday, 09:29 PM
|
Leave a comment: