How to calculate Exchange Opening Time? - NinjaTrader Programming | futures io social day trading

How to calculate Exchange Opening Time?
 Updated: January 12th, 2011 (06:08 AM) Views / Replies: 3,189 / 13 Created: January 11th, 2011 (04:35 AM) by baruchs Attachments: 1

 Welcome to futures io.

1

# How to calculate Exchange Opening Time?

 January 11th, 2011, 04:35 AM #1 (permalink) Elite Member Israel   Futures Experience: Intermediate Platform: NinjaTrader Broker/Data: pfg Favorite Futures: eminis   Posts: 323 since Jun 2009 Thanks: 6 given, 206 received How to calculate Exchange Opening Time? Hi, For my strategy I need to know the opening times of all exchanges (NY, Tokyo, Sidney, London). So I have those parameters: private int NYStart = 830; private int TokyoStart = 1800; private int SydneyStart = 1800; private int LondonStart = 200; Its for CST so I also have a parameter for CSTOffsetHours. Now I need to change those opening hours depending on different DST (day light saving times). So that is how I do it: int MonthDay = ToDay(Time[0]) % 10000; if (MonthDay > 313 && MonthDay < 1106) TokyoStart -= 100; if (!(MonthDay > 403 && MonthDay < 1002)) SydneyStart += 100; if (MonthDay > 313 && MonthDay < 2603) TokyoStart -= 100; if (MonthDay > 313 && MonthDay < 1106) LondonStart -= 100; if (MonthDay > 1030 && MonthDay < 1106) LondonStart += 100; Is this correct? Baruch

 January 11th, 2011, 04:35 AM #2 (permalink) Quick Summary Quick Summary Post Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 January 11th, 2011, 05:50 AM #3 (permalink) Elite Member Auckland   Futures Experience: Advanced Platform: Ninja Trader Broker/Data: Zen-Fire Favorite Futures: CL and ES   Posts: 715 since Apr 2010 Thanks: 3,739 given, 666 received Hi This might assist but not sure if it will Attached Thumbnails

 January 11th, 2011, 06:00 AM #4 (permalink) Elite Member Israel   Futures Experience: Intermediate Platform: NinjaTrader Broker/Data: pfg Favorite Futures: eminis   Posts: 323 since Jun 2009 Thanks: 6 given, 206 received Hi sharmas, No it does not help. I know the times. My question is about the calculaton of DST. Baruch

Elite Member
Milan (I)

Broker/Data: Kinetick
Favorite Futures: FDAX,6E,CL,YM,NQ,ES

Posts: 1,653 since Oct 2010

baruchs
 Hi, For my strategy I need to know the opening times of all exchanges (NY, Tokyo, Sidney, London). So I have those parameters: private int NYStart = 830; private int TokyoStart = 1800; private int SydneyStart = 1800; private int LondonStart = 200; Its for CST so I also have a parameter for CSTOffsetHours. Now I need to change those opening hours depending on different DST (day light saving times). So that is how I do it: int MonthDay = ToDay(Time[0]) % 10000; if (MonthDay > 313 && MonthDay < 1106) TokyoStart -= 100; if (!(MonthDay > 403 && MonthDay < 1002)) SydneyStart += 100; if (MonthDay > 313 && MonthDay < 2603) TokyoStart -= 100; if (MonthDay > 313 && MonthDay < 1106) LondonStart -= 100; if (MonthDay > 1030 && MonthDay < 1106) LondonStart += 100; Is this correct? Baruch

Hi Baruch,

Gomi is your man goto post #5 BeginTime EndTime timezone ? - Page 2 - NinjaTrader Support Forum

 January 11th, 2011, 08:50 AM #6 (permalink) Elite Member Israel   Futures Experience: Intermediate Platform: NinjaTrader Broker/Data: pfg Favorite Futures: eminis   Posts: 323 since Jun 2009 Thanks: 6 given, 206 received Thanks redratsal, Unfortunately it does not help. Gomi speaks about figuring the difference for current time from local time to exchange time and I need the difference from other (not local) time. Baruch p.s. Its the second time that I ask a question on this forum. Can anyone help? p.s.s The first question was more like a suction to help if get helped, and I got no response.

Rennes France

Broker/Data: IB/Kinetick
Favorite Futures: Futures

Posts: 3,424 since Jun 2009

Why are you using in variables instead of DateTime variables ?
You want to manipulate "the opening times of all exchanges", so it will be much easier to manipulate DateTime than int, as you have all the needed classes and methods to play with timezones.
See TimeZoneInfo class, ConvertTime, DateTimeOffset, ...
You know in which timezone are NY, Tokyo, ..., so you're also able to convert any date from a timezone to another one. And as these classes are "DST aware", I don't see where could be the problem to do what you want to do.

 Success requires no deodorant! (Sun Tzu)

 January 11th, 2011, 01:44 PM #8 (permalink) Elite Member Israel   Futures Experience: Intermediate Platform: NinjaTrader Broker/Data: pfg Favorite Futures: eminis   Posts: 323 since Jun 2009 Thanks: 6 given, 206 received Thanks sam028, That is exactly what I was looking for. Baruch

Elite Member
España

Futures Experience: None
Platform: NT
Favorite Futures: 6E

Posts: 131 since Jun 2010

sharmas
 Hi This might assist but not sure if it will

this comes handy to me that i always get lost in timezone nice summary, tnx

Elite Member
Berlin, Europe

Broker/Data: Interactive Brokers
Favorite Futures: Keyboard

Posts: 9,693 since Mar 2010
Forum Reputation: Legendary

sharmas
 Hi This might assist but not sure if it will

Some questions:

(1) This table does not take into account the different daylight saving schedules, so for Europe it will not work from March 13 to March 27, 2011 and from October 30 to November 6, 2011. Tokyo does not have any DST, so the schedule will run into problems during the summer. To display the times correctly, you would need 4 different schedules.

(2) To display the Tokyo open, you would need to introduce a column with Tokyo time, as it does not match any of the other timezones and does not use DST.

Opening hours of FOREX markets

I have visited about 20 websites for FOREX opening hours and this is the result:

Tokyo Open 6:00 PM EST in winter, 7:00 PM EST in summer
Tokyo Close 4:00 AM EST in summer 5:00 AM EST in summer
Frankfurt Open 2:00 AM EST
Frankfurt Close 11:00 AM EST
London Open 3:00 AM EST (except for the 3 weeks listed above)
London Close 12:00 PM EST (except for the 3 weeks listed above)
New York Open 8:00 AM EST
New York Close 5:00 PM EST

If I translate from your PDF: Euro Open => Frankfurt Open, London Activity => London Open, European Close => London Close, we get the same values for Europe.

I get a different value for New York (1 hour later), I only have found 4:00 PM as the New York close occasionally.

For Tokyo there are different hours for winter and summer, your opening hours at 8:00 PM are later than both the winter and summer times that I have found.

Glad if somebody knows better than this.

 futures io > How to calculate Exchange Opening Time?

Upcoming Webinars and Events (4:30PM ET unless noted)

July

Jul 17