Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace trading_calendars with exchange_calendars #178

Merged
merged 2 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions alpaca_backtrader_api/alpacastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from datetime import datetime, timedelta, time as dtime
from dateutil.parser import parse as date_parse
import time as _time
import trading_calendars
import exchange_calendars
import threading
import asyncio

Expand Down Expand Up @@ -444,7 +444,7 @@ def _make_sure_dates_are_initialized_properly(self, dtbegin, dtend,
dtend = pd.Timestamp(pytz.timezone('UTC').localize(dtend)) if \
not dtend.tzname() else dtend
if granularity == Granularity.Minute:
calendar = trading_calendars.get_calendar(name='NYSE')
calendar = exchange_calendars.get_calendar(name='NYSE')
while not calendar.is_open_on_minute(dtend):
dtend = dtend.replace(hour=15,
minute=59,
Expand Down
3 changes: 1 addition & 2 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
backtrader==1.9.76.123
alpaca-trade-api==1.2.3
trading_calendars==2.1.1

exchange_calendars==3.2