For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
How to add indicators to log file?
jesseliu0 last edited by
I added a writer to cerebro like this:
cerebro.addwriter(bt.WriterFile, csv=True, out=os.path.realpath(log_file), rounding=2)
and I tried to turn on CSV writer for one indicator in my strategy which is simply 10-day high:
def __init__(self): self.entry_high = bt.indicators.Highest(self.datas.high, period=10, csv=True)
but I got error:
TypeError: __init__() got an unexpected keyword argument 'csv'
Can you please suggest what is the correct way to add the indicator to the log file? Thank you.
self.theindicator.csv = True