-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
weekmask issue with NYSE #207
Comments
Hi @tvr101, what I sometimes do is this:
This has also bugged me a few times, I will try to have a look how this could be made more user friendly without losing the functionality. If you have any suggestions I'd be happy to hear them. |
I found a workaround: use XNYS (Mic code for NYSE) instead of NYSE:
returns
But anyway, the issue should be corrected at NYSE calendar |
given that the weekmask has changed historically, and custombusinessday object doesnt support that level of functionaltiy (changing weekmasks), i think possibly the holidays() method should be deprecated. force users to use the pandas_market_calendar calendar object directly to figure out rollbacks. |
I have not found how to get rollbacks with pandas_market_calendars. Can you give me help, please? I assumed the pandas_market_calendars should provide this functionality. Basically, I need third trading day from given date. What I am using currently:
|
Hi @pavelstovicek, not sure how this might be done within > import exchange_calendars as xcals
> xnys = xcals.get_calendar("XNYS")
> xnys.session_offset('2022-09-12', 3)
Timestamp('2022-09-15 00:00:00', freq='C') If you need to be able to work forwards from a date that might not be a session then first use the The data will be the same as the "XNYS" calendar you're using ( |
Hi the NYSE weekmask includes saturday, but this causes issues when the holidays() method is called since the CustomBusinessDay object includes saturday as a valid business day without checking if after 1952, here is an example that roll sunday 6/26 back to saturday 6/25:
import pandas_market_calendars as mcal
nyse = mcal.get_calendar("NYSE")
holidays = nyse.holidays()
holidays.rollback("2022-06-26")
Timestamp('2022-06-25 00:00:00')
The text was updated successfully, but these errors were encountered: