qablet-academy / apps-dash

0 stars 1 forks source link

Improve Data Error handling. #16

Closed somdipdatta closed 1 month ago

somdipdatta commented 2 months ago

SPX data is fake for these two dates: May 31 2021. March 29 2024.

src/runbacktest.py

The currently the code would cause an error if the Month End date generated by pd.bdate_range is a holiday for the chosen ticker.

Fix: After the month end dates are generated, get the valid dates for that ticker from the file. replace by the ME dates by a valid date closest (equal or earlier) than the month end date.

Once fixed, remove the two fake dates mentioned above (i.e. replace by blanks) and test that it works. This fix is necessary to include more tickers into the dataset which may have different trading holidays.