Plotting a LinesOperationObject
Apologies if this has been mentioned in the docs (I couldn't find it), but how do I plot a LinesOperation object that I create within a strategy? For instance, I created a
zscoreobject using two other lines, and I want to plot it. This is what I tried:
self.zscore = self.spread / self.stdev self.zscore.plotinfo.plot = True
self.stdevare two lines created previously.
I get the following error:
AttributeError: 'LinesOperation' object has no attribute 'plotinfo'.
run-out last edited by
The end of this might help.
exactly same question
So far it needs to create a new indicator for zscore and plot it
Yaroslav Horyslavets last edited by
Firstly: "lines objects from operations DO NOT GET plotted (like close_over_sma = self.data.close > self.sma)"
Second: "There is an auxiliary LinePlotterIndicator which plots such operations if wished with the following approach:"
And the example:
close_over_sma = self.data.close > self.sma LinePlotterIndicator(close_over_sma, name='Close_over_SMA') enjoy:)