NexusFi: Find Your Edge


Home Menu

 





How to calculate Exchange Opening Time?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one baruchs with 5 posts (0 thanks)
    2. looks_two Fat Tails with 3 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 sharmas with 1 posts (0 thanks)
    1. trending_up 7,116 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 13 posts
    2. attach_file 1 attachments




 
Search this Thread

How to calculate Exchange Opening Time?

  #1 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
Posts: 323 since Jun 2009

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

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
What broker to use for trading palladium futures
Commodities
 
  #3 (permalink)
 sharmas 
Auckland
 
Experience: Advanced
Platform: Ninja Trader
Broker: Zen-Fire
Trading: CL and ES
Posts: 778 since Apr 2010
Thanks Given: 3,822
Thanks Received: 750


Hi

This might assist but not sure if it will

Attached Thumbnails
How to calculate Exchange Opening Time?-timezones-lesson-3.pdf  
Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
Posts: 323 since Jun 2009

Hi sharmas,
No it does not help. I know the times. My question is about the calculaton of DST.

Baruch

Started this thread Reply With Quote
  #5 (permalink)
 
redratsal's Avatar
 redratsal 
Milan (I)
 
Experience: Advanced
Platform: Ninjatrader
Broker: Kinetick
Trading: FDAX,6E,CL,YM,NQ,ES
Posts: 1,648 since Oct 2010
Thanks Given: 1,215
Thanks Received: 2,090


baruchs View Post
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 - [AUTOLINK]NinjaTrader[/AUTOLINK] Support Forum

Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
Posts: 323 since Jun 2009

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.

Started this thread Reply With Quote
  #7 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

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)
Follow me on Twitter Reply With Quote
  #8 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
Posts: 323 since Jun 2009

Thanks sam028,
That is exactly what I was looking for.

Baruch

Started this thread Reply With Quote
  #9 (permalink)
 
redegenerated's Avatar
 redegenerated 
Espaņa
 
Experience: None
Platform: NT
Trading: 6E
Posts: 131 since Jun 2010
Thanks Given: 301
Thanks Received: 81


sharmas View Post
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

Reply With Quote
  #10 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103



sharmas View Post
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.

Reply With Quote




Last Updated on January 12, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts