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!
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
NinjaTrader
multiple session templates?
Collapse
X
-
Hello,
Thank you for the question.
Can I please clarify more details on what you are trying to accomplish?
If you are trying to do this with the same instrument I believe you would need to utilize NinjaScript and a 24 hour session template on the instrument.
Essentially you would have 24 hours of data available on the data series and you would need to create logic around the times for each session manually rather than using the session template.
If you can explain this more I will be happy to assist.JesseNinjaTrader Customer Service
-
Jessie
I wanted to capture the rth open time so I didn't have to use utc math. As I didn't want to hard code 9:30 in my code.or an adjusted 9:30 based on a persons computer time.
I am in New Zealand but my trading computer is on NY time but a friends is on California time who uses the same code. By using the base instrument templates I didn't have to create new templates and avoided any hard coding of open times.
Hope that explains it.
Currently testing:
DateTime openTimeUtc = new DateTime(Times[1][0].Year, Times[1][0].Month, Times[1][0].Day, 9, 30, 00, DateTimeKind.Utc);
DateTime tradeTimeUtc = TimeZoneInfo.ConvertTimeToUtc(Times[1][0]);
Seems to work but I need to test it on more machines with different local time zones.
CheersLast edited by ct; 11-06-2014, 12:19 PM.
Comment
-
You need to use session templates that reflect the exchange time of the instrument traded. This is the only way to comply with different daylight savings schedules throughout the year. There is no location that is always in line with UTC, and US and Europe have different daylight savings schedules, whereas most Asian countries do not follow DST.
Simple solution: Convert all local times of your PC (whether they are New Zealand, New York or Californian time) to exchange time. Alternatively, simply apply the correct session template and count the bars starting with the session break.
To access both ETH and RTH sessions within the same indicator, I have subdivided my session template into three sections. Sample session template for ES attached.
If you use UTC, you will never make it.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Brevo, Today, 01:45 AM
|
0 responses
6 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by aussugardefender, Today, 01:07 AM
|
0 responses
3 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
242 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
384 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
||
Started by oviejo, Today, 12:28 AM
|
0 responses
6 views
0 likes
|
Last Post
by oviejo
Today, 12:28 AM
|
Comment