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

XMOS: updated holidays from 2020 #352

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

iMikeBug
Copy link

@iMikeBug iMikeBug commented Jan 13, 2024

Next changes to XMOS holidays were made:

  1. Added 2 non-working days in June and July in 2020;
  2. Added extension of holidays in May 2022. However, in csv file these days are still there.

Workflow to modify an existing Exchange Calendar

  • Modify calendar class as required.
  • Modify the test resources file (e.g tests/resources/{Exchange MIC}.csv), either manually or by executing python etc/make_exchange_calendar_test_csv.py {Exchange MIC}.
  • Check if any of the fixtures in tests/test_{Exchange MIC}_calendar.py need updating to reflect your changes.
  • Add references to any new/modified holidays in exchange_calendars/exchange_calendar_{Exchange MIC}.py.

@maread99
Copy link
Collaborator

Thanks for the PR @iMikeBug, just looks like it needs linting to pass the tests. Cheers.

@iMikeBug
Copy link
Author

I couldn't find info about whether there is function for creating working Saturday. During some years there are several Saturdays when Moscow Exchange operates the full day.
Perhaps you can help to find this info?

@maread99
Copy link
Collaborator

Hi @iMikeBug, tests are failing, looks like the csv file doesn't fully reflect the changes made?

Separately, appears there's already dedicated lists for the 'labour_day_extensions' (L175) and 'victory_day_extensions' (L187). Could you place the corresponding holidays there rather than in the 'misc_adhoc' list. Thanks.

I couldn't find info about whether there is function for creating working Saturday. During some years there are several Saturdays when Moscow Exchange operates the full day.

I suspect this wouldn't be trivial to implement. One messy option that occurs to me would be to change the weekmask property for the calendar to include Saturday and set up a holiday that would treat all Saturdays as holidays except those days when the market was open. Or something like that. There might well be better ways, possibly by effectively overriding the weekmask and somehow forcing in (adding) those Saturdays when the market was open. You'd need to dig into the code to work out what the options are I'm afraid.

@iMikeBug
Copy link
Author

@maread99, thanks for your idea. Will try to implement it somehow. Maybe in another PR.
Hope that last commit will pass the tests)

@iMikeBug
Copy link
Author

iMikeBug commented Jan 16, 2024

Saw the failed test.
Frankly speaking, I don't understand the reason.
For example, my error is: AssertionError: assert Timestamp('2021-05-10 07:01:00+0000', tz='UTC') == Timestamp('2021-05-11 07:01:00+0000', tz='UTC')

I've added 2021-05-10 as a working day cause it didn't follow the rule. However, csv file didn't add this day as a working day.

@maread99
Copy link
Collaborator

I guess it's not as simple as the csv file needing to be updated again to reflect all the changes?

Michail Bugaev added 2 commits January 17, 2024 22:22
Added manually several dates as working days
fixed minor mistakes
@iMikeBug
Copy link
Author

@maread99 thanks for your help. Finally found my mistake.

@maread99
Copy link
Collaborator

Hi @iMikeBug. Sorry for not replying sooner.

Is it the case that you've manually amended the .csv file such that if in the future the script is run to automatically update the .csv the errors are going to raise again? Thanks.

@iMikeBug
Copy link
Author

iMikeBug commented Feb 3, 2024

Hi, @maread99. You're right. Unfortunately, I didn't understand the reason of this error. Calendar works correctly. But during .csv file generation working days are not added for several cases

@iMikeBug
Copy link
Author

iMikeBug commented Feb 3, 2024

Oh, I've checked again. Everything is ok😅 .csv file is automatically generated without mistakes.

@maread99
Copy link
Collaborator

Thanks @iMikeBug, now merged into the master.

@maread99 maread99 merged commit da62a20 into gerrymanoim:master Feb 13, 2024
8 checks passed
brian-from-quantrocket pushed a commit to quantrocket-llc/exchange_calendars that referenced this pull request Feb 15, 2024
Also, adds exceptions for 2021 and observance functions for certain holidays.
@iMikeBug iMikeBug deleted the XMOS-holiday-update branch February 15, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants