backtrader is a python backtesting library for trading strategies
Questions tagged [backtrader]
107 questions
-5
votes
1 answer
Can someone help me with the code? It's not working properly
import backtrader as bt
class TestStrategy(bt.Strategy):
def log(self, txt, dt=None):
''' Logging function fot this strategy'''
dt = dt or self.datas[0].datetime.date(0)
print('%s, %s' % (dt.isoformat(), txt))
def…