Skip to content

Commit 517dd52

Browse files
committed
Use bisect_right mementum#278, Address #277
1 parent 9d2b64d commit 517dd52

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

backtrader/plot/plot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ def plot(self, strategy, figid=0, numfigs=1, iplot=True,
193193
for dt in (x for x in dts if dt0 <= x <= dt1):
194194
dtidx = bisect.bisect_left(xreal, dt)
195195
xdata.append(dtidx)
196+
196197
self.pinf.xstart = bisect.bisect_left(
197198
dts, xreal[xdata[0]])
198-
self.pinf.xend = 1 + bisect.bisect_left(
199+
self.pinf.xend = bisect.bisect_right(
199200
dts, xreal[xdata[-1]])
200201

201202
for ind in self.dplotsup[data]:

0 commit comments

Comments
 (0)