Last active
December 19, 2024 13:03
-
-
Save scubamut/806b94f44c5d8681dfa9bab6f9b84357 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # MONDAY '201005031' WAS NOT TRADING DAY!!!!! | |
| !pip -q install pandas_market_calendars | |
| import pandas_market_calendars as mcal | |
| # Create a calendar | |
| nyse = mcal.get_calendar('NYSE') | |
| early = nyse.schedule(start_date='2010-05-15', end_date='2010-06-15') | |
| print(mcal.date_range(early, frequency='1D')) | |
| # REMEMBER THAT trading_days INCLUDES TODAY'S DATE!!!! | |
| # df = yf.download('SPY') | |
| # len(df is 1 LESS THAN len(trading_days)!!!!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment