Skip to content

Commit

Permalink
Replicate alpacahq#178
Browse files Browse the repository at this point in the history
  • Loading branch information
jllovet committed Dec 13, 2021
1 parent ad57fec commit 1fbe2d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
backtrader==1.9.76.123
alpaca-trade-api==1.2.3
trading_calendars==2.1.1
exchange_calendars==3.2

0 comments on commit 1fbe2d5

Please sign in to comment.