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

LSE special holidays #163

Closed
rsheftel opened this issue Sep 15, 2020 · 0 comments · Fixed by #166
Closed

LSE special holidays #163

rsheftel opened this issue Sep 15, 2020 · 0 comments · Fixed by #166

Comments

@rsheftel
Copy link
Collaborator

The LSE (XLON) exchange has special holidays as described by @matthew-tomlinson in rsheftel/pandas_market_calendars#84. These are implemented in pandas_market_calendars and need to be brought to trading_calendars. In pcal they are implemented in the https://github.com/rsheftel/pandas_market_calendars/blob/master/pandas_market_calendars/holidays_uk.py module here. There are tests in the test_exchange_calendar_lse.py that can be used to confirm.

# Early May bank holiday has two exceptions based on the 50th and 75th anniversary of VE-Day
# 1995-05-01 Early May bank holiday removed for VE-day 50th anniversary
# 2020-05-04 Early May bank holiday removed for VE-day 75th anniversary

# Early May bank holiday pre-1995
MayBank_pre_1995 = Holiday(
    "Early May Bank Holiday",
    month=5,
    offset=DateOffset(weekday=MO(1)),
    day=1,
    end_date=Timestamp('1994-12-31'),
)

# Early May bank holiday post-1995 and pre-2020
MayBank_post_1995_pre_2020 = Holiday(
    "Early May Bank Holiday",
    month=5,
    offset=DateOffset(weekday=MO(1)),
    day=1,
    start_date=Timestamp('1996-01-01'),
    end_date=Timestamp('2019-12-31'),
)

# Early May bank holiday post 2020
MayBank_post_2020 = Holiday(
    "Early May Bank Holiday",
    month=5,
    offset=DateOffset(weekday=MO(1)),
    day=1,
    start_date=Timestamp('2021-01-01')
)

# Spring bank holiday has two exceptions based on the Golden & Diamond Jubilee
# 2002-05-27 Spring bank holiday removed for Golden Jubilee
# 2012-05-28 Spring bank holiday removed for Diamond Jubilee

# Spring bank holiday
SpringBank_pre_2002 = Holiday(
    "Spring Bank Holiday",
    month=5,
    day=31,
    offset=DateOffset(weekday=MO(-1)),
    end_date=Timestamp('2001-12-31'),
)

SpringBank_post_2002_pre_2012 = Holiday(
    "Spring Bank Holiday",
    month=5,
    day=31,
    offset=DateOffset(weekday=MO(-1)),
    start_date=Timestamp('2003-01-01'),
    end_date=Timestamp('2011-12-31'),
)

SpringBank_post_2012 = Holiday(
    "Spring Bank Holiday",
    month=5,
    day=31,
    offset=DateOffset(weekday=MO(-1)),
    start_date=Timestamp('2013-01-01'),
)
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.

1 participant