Skip to content

Commit f58bc4f

Browse files
committed
fix call to is_market_open when using the new exchange_calendars
1 parent 1b537ac commit f58bc4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

alpaca_backtrader_api/alpacastore.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def _make_sure_dates_are_initialized_properly(self, dtbegin, dtend,
445445
not dtend.tzname() else dtend
446446
if granularity == Granularity.Minute:
447447
calendar = exchange_calendars.get_calendar(name='NYSE')
448-
while not calendar.is_open_on_minute(dtend):
448+
while not calendar.is_open_on_minute(dtend.ceil(freq='T')):
449449
dtend = dtend.replace(hour=15,
450450
minute=59,
451451
second=0,

0 commit comments

Comments
 (0)