AlpacaTechJP / trading_calendars

Calendars for various securities exchanges.
Apache License 2.0
0 stars 0 forks source link

Feature/2023 trading calendar update #56

Closed sercant closed 1 year ago

sercant commented 1 year ago

This PR adds tests and fix for the 2023 XTKS and XNYS.

Reference XNYS: https://www.nyse.com/markets/hours-calendars Reference XTKS: https://www.jpx.co.jp/english/corporate/about-jpx/calendar/index.html

outcome:

  1. XNYS trading calendar does not need update.
  2. XTKS trading calendar needs update.
camelxpaca commented 1 year ago

@sercant may I add XLON updates as well? I want to use it for 2023 https://www.londonstockexchange.com/securities-trading/trading-access/business-days

sercant commented 1 year ago

@camelxpaca , if possible let's not use this legacy library ... shall we talk about it when you have time?

Upstream stopped support for it so only reason to keep this version alive is legacy projects.

there is exchange_calendars version that we also maintain (here), that one gets updated on upstream.

camelxpaca commented 1 year ago

@camelxpaca , if possible let's not use this legacy library ... shall we talk about it when you have time? Upstream stopped support for it so only reason to keep this version alive is legacy projects. there is exchange_calendars version that we also maintain (here), that one gets updated on upstream.

Oh.... I see. I need a similar functionality for TUR right now so thank you also for the suggestion. I didn't know this existed, and I was super confused that this is called a different thing but just in a different branch of the same repo.

sercant commented 1 year ago

yes, it is super confusing and hard to manage. @beppe712 has plans to work on a trading calendar library that does not need yearly updates.

camelxpaca commented 1 year ago

@beppe712 @sercant how do I install this exchange_calendars in Poetry? like this?

exchange-calendars = {git = "https://github.com/AlpacaTechJP/trading_calendars.git", rev = "exchange-calendars-head"} 
sercant commented 1 year ago

actually I would suggest just pre generate the trading holidays using a library like this and then put it into a file. then you can manage it with a configmap. that would be the best. read it in the code and use with pd.bday_range and exclude those dates.