mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-13 17:42:42 +08:00
3541115b4e
For consistency, datetimes returned by the trading calendar should
always show HHMMSS of midnight UTC. Not only is this useful for
consistency, but it also allows us to check if a particular date() is
in an array of these datetimes, because they will hash to the same
thing. For example:
early_closes = get_early_closes()
... later ...
if current_bar_datetime.date() in early_closes:
... today closes early ...
If if the datetimes returned by the trading calendar functions don't
have 00:00:00 for HHMMSS, then the "in" check above will fail because
the date and the datetimes in early_closes won't hash to the same
thing.