@@ -613,7 +613,7 @@ def getbroker(self):
613613
614614 broker = property (getbroker , setbroker )
615615
616- def plot (self , plotter = None , numfigs = 1 , iplot = True , useplotly = False ,
616+ def plot (self , plotter = None , numfigs = 1 , iplot = True , start = 0 , end = - 1 ,
617617 ** kwargs ):
618618 '''
619619 Plots the strategies inside cerebro
@@ -627,6 +627,13 @@ def plot(self, plotter=None, numfigs=1, iplot=True, useplotly=False,
627627 ``iplot``: if ``True`` and running in a ``notebook`` the charts will be
628628 displayed inline
629629
630+ ``start``: An index to the datetime line array of the strategy or a
631+ ``datetime.date``, ``datetime.datetime`` instance indicating the start
632+ of the plot
633+
634+ ``end``: An index to the datetime line array of the strategy or a
635+ ``datetime.date``, ``datetime.datetime`` instance indicating the end
636+ of the plot
630637 '''
631638 if self ._exactbars > 0 :
632639 return
@@ -638,14 +645,6 @@ def plot(self, plotter=None, numfigs=1, iplot=True, useplotly=False,
638645 else :
639646 plotter = plot .Plot (** kwargs )
640647
641- if useplotly :
642- try :
643- from plotly import __version__ as plyversion
644- except ImportError :
645- useplotly = False
646- else :
647- numfigs = 1 # Let plotly manage zoom, panning ... only 1 fig
648-
649648 # pfillers = {self.datas[i]: self._plotfillers[i]
650649 # for i, x in enumerate(self._plotfillers)}
651650
@@ -657,29 +656,14 @@ def plot(self, plotter=None, numfigs=1, iplot=True, useplotly=False,
657656 for si , strat in enumerate (stratlist ):
658657 rfig = plotter .plot (strat , figid = si * 100 ,
659658 numfigs = numfigs , iplot = iplot ,
660- useplotly = useplotly )
659+ start = start , end = end )
661660 # pfillers=pfillers2)
662661
663662 figs .append (rfig )
664663
665664 plotter .show ()
666665 return figs
667666
668- def plotly (self , plotter = None , numfigs = 1 , ** kwargs ):
669- '''
670- Plots the strategies inside cerebro in plotly offline if available
671-
672- If ``plotter`` is None a default ``Plot`` instance is created and
673- ``kwargs`` are passed to it during instantiation.
674-
675- ``numfigs`` split the plot in the indicated number of charts reducing
676- chart density if wished
677-
678- If ``plotly`` is really available this will be capped down to 1 to
679- let plotly take over and control those features
680- '''
681- self .plot (plotter = plotter , numfigs = numfigs , useplotly = True , ** kwargs )
682-
683667 def __call__ (self , iterstrat ):
684668 '''
685669 Used during optimization to pass the cerebro over the multiprocesing
0 commit comments