mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-11 23:06:36 +08:00
TST: Ensure that test bars and events use midnight for daily data.
Daily data should be using midnight as the timestamp, ensure that test data created by data_gen use midnight, so that upcoming implementations that rely on the timestamp will be compatible.
This commit is contained in:
@@ -59,6 +59,11 @@ def date_gen(start=datetime(2006, 6, 6, 12, tzinfo=pytz.utc),
|
||||
"""
|
||||
one_day = timedelta(days=1)
|
||||
cur = start
|
||||
if delta == one_day:
|
||||
# if we are producing daily timestamps, we
|
||||
# use midnight
|
||||
cur = cur.replace(hour=0, minute=0, second=0,
|
||||
microsecond=0)
|
||||
|
||||
# yield count trade events, all on trading days, and
|
||||
# during trading hours.
|
||||
|
||||
Reference in New Issue
Block a user