Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Daylight Savings Problem
 Post subject: Daylight Savings Problem Post rating: 0   New post Posted: Mon 28 Mar, 2011, 10:36 
User avatar

User rating: 0
Joined: Tue 07 Dec, 2010, 10:51
Posts: 39
Hey everyone,

I'm still struggling with the daylight savings problem. My strategies trade only market openings, and according to my knowledge that time changes twice a year, on the last Sunday of October and the last Sunday of March.

Can someone please explain to me how this works? If I use this code:


       Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
       calendar.setTimeInMillis(_signalBarTime);
       int _hours=calendar.get(Calendar.HOUR_OF_DAY);




Is the _hours value = 8 always the London open, and the _hours value = 13 always the New York open, or does this differ during twice a year?


 
 Post subject: Re: Daylight Savings Problem Post rating: 0   New post Posted: Thu 09 Jun, 2011, 15:06 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Consider the TimeZone.inDaylightTime method:
https://download.oracle.com/javase/1.4.2/docs/api/java/util/TimeZone.html#inDaylightTime(java.util.Date)
Consider the market hours:
https://www.babypips.com/school/trading-sessions.html


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com