Solution to Plotting Issue Regarding Indicator with Single Price Line Input
Although I did try to implement a custom plotter using
plotlyin order to solve the problem as I believed that it was caused by the default plotter
matplotlib, I finally realized that the problem is caused by providing a price line as an input to the indicator.
__init__method shall look like the following.
def __init__(self): self.sma = sma = btind.SMA(self.data1.open) # use open price liz sma.plotinfo.plot = True # show plotting if self.p.multi: self.sma1 = sma() # couple the entire indicators ''' By providing only a price line to the indicator, the clock of the `LinesCoupler` object `self.sma1` won't be updated, it shall be set manually. ''' self.sma1._clock = self.data0 self.sellsignal = self.data0.close < self.sma1.sma else: self.sellsignal = self.data0.close < sma.sma()