Skip to content

Commit

Permalink
Merge pull request #178 from Tantalon/fix/trading_calendars_broken
Browse files Browse the repository at this point in the history
replace trading_calendars with exchange_calendars
  • Loading branch information
haxdds authored Dec 21, 2021
2 parents ad57fec + 75ee9af commit 1b537ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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

0 comments on commit 1b537ac

Please sign in to comment.