question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NYSE Exchange Calendar

See original GitHub issue

@glossner I have been working on an update for the MarketCalendar, which made me encounter a couple of things that I wanted your thoughts on.

  • In holidays_nyse.py, the date 1990-12-24 was in both lists, ChristmasEve1pmEarlyCloseAdhoc and ChristmasEve2pmEarlyCloseAdhoc. In the tests you seem to be checking whether the close was at 2pm, so I removed the date from the 1pm list. This is correct, right?

  • In a couple of places in NYSEExchangeCalendar, you (or shall I say we) rounded the times before 1901-12-14 because of a 4min timezone shift. Thinking about it, this may actually not be a good idea since technically that would be the incorrect time. Correct me if I’m wrong, but we would artifically be adding 4 minutes, and the following isn’t what a user might expect:

sched = nyse.schedule("1901-12-12", "1901-12-16")
sched
>>>
                         market_open              market_close
1901-12-12 1901-12-12 15:00:00+00:00 1901-12-12 20:00:00+00:00
1901-12-13 1901-12-13 15:00:00+00:00 1901-12-13 20:00:00+00:00
1901-12-14 1901-12-14 15:00:00+00:00 1901-12-14 17:00:00+00:00
1901-12-16 1901-12-16 15:00:00+00:00 1901-12-16 20:00:00+00:00

sched.market_open.dt.tz_convert(nyse.tz)
>>>
1901-12-12   1901-12-12 10:04:00-04:56  # a user would have to know that these need to be rounded 
1901-12-13   1901-12-13 10:04:00-04:56  # and are actually 4 minutes off
1901-12-14   1901-12-14 10:00:00-05:00 
1901-12-16   1901-12-16 10:00:00-05:00
Name: market_open, dtype: datetime64[ns, America/New_York]

s
>>>
1901-12-12   1901-12-12 10:00:00-04:56
1901-12-13   1901-12-13 10:00:00-04:56
1901-12-14   1901-12-14 10:00:00-05:00
1901-12-16   1901-12-16 10:00:00-05:00
dtype: datetime64[ns, America/New_York]

s == sched.market_open
>>>
1901-12-12    False
1901-12-13    False
1901-12-14     True
1901-12-16     True
dtype: bool

If you want to, you can check out #150 PR and/or my fork, where I have implemented the calculations without rounding and have all tests pass with only minor tweaks.

Any thoughts or suggestions regarding this or the update are greatly appreciated.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Stryder-Gitcommented, Sep 27, 2021

@glossner, regarding special/multiple breaks, that may be a bit tricky and only rarely used so I will think about how to implement that at a later date.

@rsheftel, these changes are already part of #150! Unless you disagree, I didn’t consider this pressing enough to create a separate PR for it.

I am going to take the liberty to close this issue and keep an eye on #150 instead.

Thanks!

0reactions
rsheftelcommented, Sep 27, 2021

@Stryder-Git are these changes part of your #150 PR, or did you make another branch to submit a different PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Holidays and Trading Hours - NYSE
All NYSE markets observe U.S. holidays as listed below for 2022, 2023, and 2024. ; Labor Day, Monday, September 5, Monday, September 4,...
Read more >
NYSE GROUP ANNOUNCES 2020, 2021 AND 2022 ...
* Each market will close early at 1:00 p.m. (1:15 p.m. for eligible options) on Friday, November 27, 2020, Friday, November 26, 2021,...
Read more >
2022 NYSE Market Holidays - CalendarLabs
List of Trading Holidays of NYSE Market in 2022 ; Jan 17, 2022Jan 17, M L King Day ; Feb 21, 2022Feb 21,...
Read more >
Stock Market Holiday Calendar - Investing.com
Date Country Exchange Name Holiday Dec 23, 2022 Australia Sydney Stock Exchange Christmas ‑ Early close at 14:30 Ireland Ireland Stock Exchange Christmas ‑ Early...
Read more >
NYSE Trading Hours & Market Holidays [2022-2023]
The New York Stock Exchange is open Monday through Friday from 9:30 am to 4:00 pm Eastern Standard Time (GMT-05:00). The New York...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found