Skip to content

Commit 9d2b64d

Browse files
dimitar-petrovmementum
authored andcommitted
Adjust synchronization when multiple datas are added with resampling (mementum#278)
* Fix plotting when multiple data with resampling is added - also fixes plotting with numfigs > 1 with resampled data * Remove None assignment from self.pinf.{xstart,xend}
1 parent d9c06f4 commit 9d2b64d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

backtrader/plot/plot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +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+
self.pinf.xstart = bisect.bisect_left(
197+
dts, xreal[xdata[0]])
198+
self.pinf.xend = 1 + bisect.bisect_left(
199+
dts, xreal[xdata[-1]])
196200

197201
for ind in self.dplotsup[data]:
198202
self.plotind(

0 commit comments

Comments
 (0)