How to skip the plot of some datas in a mutidata strategy
-
In an indicator development, simply adding a _plotskip=True command, can skip the plot of a specific line. But how to skip the plot of some datas in a mutidata strategy?
I have tried the following, but it does not work? data_0 and data_1 are still plotted. Any suggestions?data_0 = bt.feeds.PandasData(dataname=data_index, tz=tz_cn) data_0.plotinfo._plotskip = True cerebro.adddata(data_0) data_1 = cerebro.replaydata(data_0, timeframe=getattr(bt.TimeFrame, 'Weeks')) data_1.plotinfo._plotskip = True
-
@weibudda said in How to skip the plot of some datas in a mutidata strategy:
data_0 = bt.feeds.PandasData(dataname=data_index, tz=tz_cn)
data_0.plotinfo._plotskip = True
cerebro.adddata(data_0)I have an answer for you but it might not be the best one. I don't use the built in plotting very much. So someone else may have a more
backtrader
proper answer.That all said, you can set the attribute directly after creating data_0.
data_0.plotinfo.plot = False
I think you need at least one dataline plotting for the chart to execute.
-
@run-out said in How to skip the plot of some datas in a mutidata strategy:
data_0.plotinfo.plot = False
Problem has been solved, thanks very much!