Questions tagged [backtrader]

backtrader is a python backtesting library for trading strategies

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…
1 2 3 4 5 6 7
8