how to disable plotting resample data
Is there any way to disable plotting resample data? I tried and failed to figure it out.
thanks a lot!
ab_trader last edited by ab_trader
Plotting of any data can be turned off using the
plotparameter when you define your data feed (
datais your resampled data feed):
data = bt.feeds.GenericCSVData(dataname=datapath, fromdate=dt.datetime(1900, 1, 1), todate=dt.datetime(2018, 12, 31), plot=False)
or (didn;t use it but should work)
data = bt.feeds.GenericCSVData(dataname=datapath) data.plotinfo.plot = False
@ab_trader I tried, but it only disable plotting the original data, not the resampled data.
@ab_trader is telling you how to disable plotting for any data, because you are not showing any code and thus cannot tell where you are doing things wrong
Have you done that for the resampled data instance?
data = bt.feeds.PandasData(dataname=dt, plot=False)
cerebro.resampledata(data, timeframe=bt.TimeFrame.Minutes, compression=1)
I use the above code but I am not sure where to put 'plot=false' for resample data. Your advice is much appreciated! thanks
data.plotinfo.plot = False
As indicated by @ab_trader you don't have to put necessarily in the constructor, but if you wish pass it to
resampledataas indicated by the documentation
Or receive the resampled data instance as the result of calling
resampledataand do as told by @ab_trader