Excuse me please help me to see why an error is reported when running the drawing code
-
Traceback (most recent call last):
File "C:/Users/阿斯顿/PycharmProjects/Career/pythonProject3/main.py", line 148, in <module>
cerebro.plot()
File "D:\python\lib\site-packages\backtrader\cerebro.py", line 974, in plot
from.import plot
File "D:\python\lib\site-packages\backtrader\plot_init_.py", line 13
def notify_trade(self, trade):
^
IndentationError: expected an indented block -
@T-yellow its a python error not from BT. make sure you code has correct indentation (spaces).
-
still the same
File "D:\python\lib\site-packages\backtrader\cerebro.py", line 974, in plot
from.import plot -
@T-yellow Where is your code? It's difficult to identify the problem in the first place without being able to see the code.
-
@T-yellow said in Excuse me please help me to see why an error is reported when running the drawing code:
def notify_trade(self, trade):
Python error. If you have no function lines in the def notify_trade() function, you'll get an error. Either comment out that line, or put inpass
after it.def notify_trade(self, trade): pass