mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-19 11:22:06 +08:00
BUG: Don't include out-of-range date in early closes
Don't include New Year's Eve 1999 in the early closes returned to the user if it's outside the range of dates requested by the user.
This commit is contained in:
@@ -346,6 +346,8 @@ def get_early_closes(start, end):
|
||||
# http://www.nyse.com/pdfs/closings.pdf
|
||||
#
|
||||
# New Year's Eve
|
||||
early_closes.append(datetime(1999, 12, 31, tzinfo=pytz.utc))
|
||||
nye_1999 = datetime(1999, 12, 31, tzinfo=pytz.utc)
|
||||
if start <= nye_1999 and nye_1999 <= end:
|
||||
early_closes.append(nye_1999)
|
||||
|
||||
return pd.DatetimeIndex(sorted(early_closes))
|
||||
|
||||
Reference in New Issue
Block a user