Back

Daylight savings Timezone confusion

Hi all... I realise there are already quite a few posts about timezone questions, mine is specific to daylight savings and London Forex open times

When neither New York nor London are in daylight savings, London opens at 3am NY time (10 hours after NY close at 5pm). What time does London open (with respect to timestamp on QuantConnect data) when (a) NY is in DST but London is not, and (b) when both cities are in DST?

The way I figure it is that for (a) London still opens at 3am wrt QuantConnect timestamp (9 hours after NY close at 6pm), and (b) when London enters DST two weeks later it will open at 4am wrt QuantConnect timestamp (10 hours after NY close).

Does that sound right? I've been tying myself in knots trying to figure it out.

Thanks,

Joel

Update Backtest







0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi Joel,

Do you have a specific algorithm in mind that will require taking this information into account? If so, feel free to share it and that will give us a good idea of what you are trying to do with/to accommodate DST. Outside of that, I can tell you that our Forex data comes from either Oanda or FXCM, depending on the market specified by the user in an algorithm. Oanda data is time-stamped in UTC time and so New York and London will shift from UTC-5 to UTC-4 and from UTC to UTC+1, respectively, when they move into Daylight Saving Time. FXCM data is time-stamped at US/Eastern Standard Time, or UTC-5. You can find more information on our data hours/time zones here and here.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi Jack

Thank you for taking the time to reply. I have attached a bare-bones backtest (using FXCM data, so US/Eastern Standard time). Ultimately what I want to code is a "London breakout" algorithm for Forex, so I need to know when it's 8 am in London. This backtest doesn't have any trading logic, it just does the following:

1) prints a dot on the chart for the value of "GBPUSD" at 3 am (well it should be 'SeriesType.Scatter', but it's printing as a line in my Algorithm Lab). Should be Blue for no DST, Green for NY = DST, Red for both NY and UK = DST.

2) when the current hour is 3 am, the string "3 am" is printed to the log (log output pasted below)

Basically, what I can't figure out is what time is 8 am in London with respect to the timestamps in the log. I understand that when neither location is in DST, 3 am EST is 8 am in London. However when New York is in DST, 3 am prints as 4 am in the log. Is 8 am in London still 3 am in the log, or is it now 4 am? When both locations are in DST, is 8 am in London now 4 am in the log or has it returned to 3 am?

** A note about how I have coded the backtest. It uses 'Resolution.Second' data and a custom consolidator to produce hourly consolidated bars. This is because the algorithm I want to code needs to make trading decisions every second but also relies on hourly SMA values.

Regards,
Joel

P.S. I don't know if the time of each data point is displaying correctly here... I'm seeing them as 8 am after  I attached the backtest (and I'm in Australia, so not even my local time for 3 am EST New York)

--------

2018-03-05 03:00:00 3 am
2018-03-06 03:00:00 3 am
2018-03-07 03:00:00 3 am
2018-03-08 03:00:00 3 am
2018-03-09 03:00:00 3 am
2018-03-12 04:00:00 3 am
2018-03-13 04:00:00 3 am
2018-03-14 04:00:00 3 am
2018-03-15 04:00:00 3 am
2018-03-16 04:00:00 3 am
2018-03-19 04:00:00 3 am
2018-03-20 04:00:00 3 am
2018-03-21 04:00:00 3 am
2018-03-22 04:00:00 3 am
2018-03-23 04:00:00 3 am
2018-03-26 04:00:00 3 am
2018-03-27 04:00:00 3 am
2018-03-28 04:00:00 3 am
2018-03-29 04:00:00 3 am
2018-03-30 04:00:00 3 am
0


Hi Joel,

So the default timezone for the timestamps in the logs is US/Eastern (i.e., New York) but this is not fixed, and so the timestamps show the switch from UTC-5 to UTC-4. This closes the gap with London from 5-hours to 4-hours, and so 8 am London time now corresponds to 4 am NY time. When London enters BST, then 8 am London time is 3 am NY time again. So, briefly, the relationship between NY local time and London local time, keeping London time fixed at 8am, is:
 

1) 3am / 8am (UTC-5 / UTC)
2) 4am / 8am (UTC-4 / UTC)
3) 3am / 8am (UTC-4 / UTC+1)

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


That's great Jack, thank you. I think the confusion is also about sampling in OnData() and how that changes. So I guess I would do:

1)  UTC-5 / UTC:    sample at 3am in OnData() = 3am in timestamp = 8am London
2) UTC-4 / UTC:    sample at 3am in OnData() = 4am in timestamp = 8am London
3) UTC-4 / UTC+1: sample at 2am in OnData() = 3am in timestamp = 8am London

0

Correct, you can see this in the backtest I've attached where the timezone is set to London. The data timestamp is fixed to UTC-5, and so the QuoteBar.EndTime will be 3am when London is 8am, until London enters BST at which point you can see in the logs that QuoteBar.EndTime is 2am when London is 8am. The timestamps you see in the log is for the algorithm's timezone, and so if you leave it at the default then this will show New York time.

1

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed