mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-15 11:22:18 +08:00
BUG: Fix bad dates from test factory.
Passing the exchange time timestamp to is_market_hours was ending up with odd behavior due to conversion back to UTC when checking the is_trading_day boolean.
This commit is contained in:
@@ -139,7 +139,7 @@ def get_next_trading_dt(current, interval):
|
||||
next_dt = next_dt + interval
|
||||
next_dt = pd.Timestamp(next_dt, tz=trading.environment.exchange_tz)
|
||||
next_dt_utc = next_dt.tz_convert('UTC')
|
||||
if trading.environment.is_market_hours(next_dt):
|
||||
if trading.environment.is_market_hours(next_dt_utc):
|
||||
break
|
||||
next_dt = next_dt_utc.tz_convert(trading.environment.exchange_tz)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user