Skip to content
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

NYSE Calendar differences prior to 1990 #162

Closed
rsheftel opened this issue Sep 15, 2020 · 2 comments · Fixed by #169
Closed

NYSE Calendar differences prior to 1990 #162

rsheftel opened this issue Sep 15, 2020 · 2 comments · Fixed by #169

Comments

@rsheftel
Copy link
Collaborator

I see that the earliest starting date for the NYSE (XNYS) calendar is 1990-01-01 and from that date onwards the trading_calendars and pandas_market_calendars implementation are the same. But prior to that date there are many changes in the holiday calendar that pcal has that trading_calendars does not. If you are OK, I would suggest bringing over the pre-1990 holidays.

These holidays were added by @pldrouin in rsheftel/pandas_market_calendars#30. He was nice enough to upload a csv of all the holidays in the /tests/data/nyse_all_full_day_holidays_since_1928.csv and the results can be verified here: http://s3.amazonaws.com/armstrongeconomics-wp/2013/07/NYSE-Closings.pdf

Example:

trading_calendars:

from .us_holidays import (
    USNewYearsDay,
    USMartinLutherKingJrAfter1998,
    USMemorialDay,
    USIndependenceDay,
    Christmas,
    MonTuesThursBeforeIndependenceDay,
    FridayAfterIndependenceDayExcept2013and2019,
    USBlackFridayBefore1993,
    USBlackFridayInOrAfter1993,
    September11Closings,
    HurricaneSandyClosings,
    HurricaneGloriaClosing,
    NewYorkBlackout,
    PresidentialElectionDays,
    USNationalDaysofMourning,
    ChristmasEveBefore1993,
    ChristmasEveInOrAfter1993,
)

pandas_market_calendars

def regular_holidays(self):
       return AbstractHolidayCalendar(rules=[
           USNewYearsDay,
           USMartinLutherKingJrAfter1998,
           USLincolnsBirthDayBefore1954,
           USWashingtonsBirthDayBefore1964,
           USWashingtonsBirthDay1964to1970,
           USPresidentsDay,
           GoodFriday,
           USMemorialDayBefore1964,
           USMemorialDay1964to1969,
           USMemorialDay,
           USIndependenceDayBefore1954,
           USIndependenceDay,
           USLaborDay,
           USThanksgivingDayBefore1939,
           USThanksgivingDay1939to1941,
           USThanksgivingDay,
           USElectionDay1848to1967,
           USElectionDay1968to1980,
           USVeteransDay1934to1953,
           USColumbusDayBefore1954,
           ChristmasBefore1954,
           Christmas,
       ])
@gerrymanoim
Copy link
Collaborator

@jmccorriston - this makes sense to me. Thoughts?

@jmccorriston
Copy link
Contributor

Yeah, I have not done the Research pre-1990, and we don't depend on that for Q, so let's pull it in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants