You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zipline Trader is currently using Q trading_calendars that is not maintained. Former Q Software Engineer Gerry Manoim started to maintain this callendar under new name exchange_calendars, however there are depreciated some items that zipline is using.
I have opened issue in Gerry's repo's if we could work together. If zipline trader can use Gerry's exchange_calendar or maintain it's own.
Currently Q trading_calendars is getting old and doesn't work the same way under old and new pandas.
When I run the code below I get different results:
pandas 0.22,: true
pandas 1.1.5 : false (No error reported)
import pandas as pd
import trading_calendars
from trading_calendars import TradingCalendar
from datetime import timedelta, time as dtime
pd.__version__
cal: TradingCalendar = trading_calendars.get_calendar('NYSE')
end_date = pd.Timestamp('now', tz='utc').date() - timedelta(days=1)
cal.is_session(end_date)
Quick work around is to add timestamp: cal.is_session(pd.Timestamp(end_date, tz='utc')
Zipline Q trading_calendars used to have open times one minute later.
Why are open times one minute late?
Due to its historical use in the Zipline backtesting system, trading_calendars will only indicate a market is open upon the completion of the first minute bar in a day. Zipline uses minute bars labeled with the end of the bar, e.g. 9:31AM for 9:30-9:31AM. As an example, on a regular trading day for NYSE:
9:30:00 is treated as closed.
9:30:01 is treated as closed.
9:31:00 is the first time treated as open.
16:00:00 is treated as open
16:00:01 is treated as closed
This may change in the future.
The text was updated successfully, but these errors were encountered:
Zipline Trader is currently using Q trading_calendars that is not maintained. Former Q Software Engineer Gerry Manoim started to maintain this callendar under new name exchange_calendars, however there are depreciated some items that zipline is using.
I have opened issue in Gerry's repo's if we could work together. If zipline trader can use Gerry's exchange_calendar or maintain it's own.
Currently Q trading_calendars is getting old and doesn't work the same way under old and new pandas.
When I run the code below I get different results:
pandas 0.22,: true
pandas 1.1.5 : false (No error reported)
Quick work around is to add timestamp:
cal.is_session(pd.Timestamp(end_date, tz='utc')
Zipline Q trading_calendars used to have open times one minute later.
Why are open times one minute late?
Due to its historical use in the Zipline backtesting system, trading_calendars will only indicate a market is open upon the completion of the first minute bar in a day. Zipline uses minute bars labeled with the end of the bar, e.g. 9:31AM for 9:30-9:31AM. As an example, on a regular trading day for NYSE:
9:30:00 is treated as closed.
9:30:01 is treated as closed.
9:31:00 is the first time treated as open.
16:00:00 is treated as open
16:00:01 is treated as closed
This may change in the future.
The text was updated successfully, but these errors were encountered: