@@ -113,7 +113,7 @@ def drawtag(self, ax, x, y, facecolor, edgecolor, alpha=0.9, **kwargs):
113113 ** kwargs )
114114
115115 def plot (self , strategy , figid = 0 , numfigs = 1 , iplot = True ,
116- start = 0 , end = - 1 , ** kwargs ):
116+ start = None , end = None , ** kwargs ):
117117 # pfillers={}):
118118 if not strategy .datas :
119119 return
@@ -134,12 +134,20 @@ def plot(self, strategy, figid=0, numfigs=1, iplot=True,
134134 self .calcrows (strategy )
135135
136136 st_dtime = strategy .lines .datetime .plot ()
137+ if start is None :
138+ start = 0
139+ if end is None :
140+ end = len (st_dtime )
141+
137142 if isinstance (start , datetime .date ):
138143 start = bisect .bisect_left (st_dtime , date2num (start ))
139144
140145 if isinstance (end , datetime .date ):
141146 end = bisect .bisect_right (st_dtime , date2num (end ))
142147
148+ if end < 0 :
149+ end = len (st_dtime ) + 1 + end # -1 = len() -2 = len() - 1
150+
143151 slen = len (st_dtime [start :end ])
144152 d , m = divmod (slen , numfigs )
145153 pranges = list ()
@@ -194,10 +202,11 @@ def plot(self, strategy, figid=0, numfigs=1, iplot=True,
194202 dtidx = bisect .bisect_left (xreal , dt )
195203 xdata .append (dtidx )
196204
197- self .pinf .xstart = bisect .bisect_left (
198- dts , xreal [xdata [0 ]])
199- self .pinf .xend = bisect .bisect_right (
200- dts , xreal [xdata [- 1 ]])
205+ if False :
206+ self .pinf .xstart = bisect .bisect_left (
207+ dts , xreal [xdata [0 ]])
208+ self .pinf .xend = bisect .bisect_right (
209+ dts , xreal [xdata [- 1 ]])
201210
202211 for ind in self .dplotsup [data ]:
203212 self .plotind (
0 commit comments