During installation and use of backtrader_plotting, an error was reported.
Traceback (most recent call last):
File “main.py”, line 86, in
cerebro.plot(b)
File “C:\ProgramData\Anaconda3\lib\site-packages\backtrader\cerebro.py”, line 991, in plot
start=start, end=end, use=use)
File “C:\ProgramData\Anaconda3\lib\site-packages\backtrader_plotting-2.0.0-py3.7.egg\backtrader_plotting\bokeh\bokeh.py”,
line 516, in plot
self._blueprint_strategy(obj, start, end, tradingdomain, **kwargs)
File “C:\ProgramData\Anaconda3\lib\site-packages\backtrader_plotting-2.0.0-py3.7.egg\backtrader_plotting\bokeh\bokeh.py”,
line 228, in _blueprint_strategy
figureenv.plot(master)
File “C:\ProgramData\Anaconda3\lib\site-packages\backtrader_plotting-2.0.0-py3.7.egg\backtrader_plotting\bokeh\figure.py”, line 180, in plot
self.plot_data(obj)
File “C:\ProgramData\Anaconda3\lib\site-packages\backtrader_plotting-2.0.0-py3.7.egg\backtrader_plotting\bokeh\figure.py”, line 253, in plot_data
title = sanitize_source_name(labelizer.label(data))
File “C:\ProgramData\Anaconda3\lib\site-packages\backtrader_plotting-2.0.0-py3.7.egg\backtrader_plotting\bokeh\labelizer.py”, line 84, in label
primary = _label_datafeed(obj)
File “C:\ProgramData\Anaconda3\lib\site-packages\backtrader_plotting-2.0.0-py3.7.egg\backtrader_plotting\bokeh\labelizer.py”, line 52, in _label_datafeed
raise RuntimeError(f’Unexpected data type: {data.__class__}’)
RuntimeError: Unexpected data type:
Check that it is the getattr(data, n, “”) statement that cannot get the name of the data, so it needs to be actively assigned, modifying the main code.
# Load data
cerebro.adddata(data)
for
# Load data
codename=’510300′
cerebro.adddata(data,name=codename)
Problem solved.
Read More:
- [Solved] torchsummary Error: RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.F
- [Solved] RuntimeError: unexpected EOF, expected 73963 more bytes. The file might be corrupted.
- [Solved] RuntimeError: expected scalar type Long but found Float
- [Solved] RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the
- [Solved] Pytorch Error: RuntimeError: expected scalar type Double but found Float
- Pytorch Error: RuntimeError: value cannot be converted to type float without overflow: (0.00655336,-0.00
- Pytorch Error: runtimeerror: expected scalar type double but found float
- [Solved] Using summary to View network parameters Error: RuntimeError: Input type (torch.cuda.FloatTensor)
- Python 3.X error: valueerror: data type must provide an itemsize
- [Solved] Arcpy: RuntimeError: ERROR 999998: Unexpected Error.
- [Solved] YOLOv5 Model training error: TypeError: new(): invalid data type ‘str’
- [Solved] python tqdm raise RuntimeError(“cannot join current thread“) RuntimeError: cannot join current thr
- Decode PUP data Error when reading radar data [How to Solve]
- Extracting Data from XML (Using Python to Access Web Data)
- How to Solve Error: RuntimeError CUDA out of memory
- [Solved] mmdetection benchmark.py Error: RuntimeError: Distributed package doesn‘t have NCCL built in
- RuntimeError: Address already in use [How to Solve]
- [Solved] Pyinstaller Error: “RuntimeError: No metadata path found for distribution ‘greenlet‘
- [Solved] Python matplotlib Error: RuntimeError: In set_size: Could not set the fontsize…
- [Solved] RuntimeError: run loop already started raise RuntimeError(‘run loop already started‘)