Backtrader transaction Foundation
View account status:
class TestStrategy(bt.Strategy):
def next(self):
print('Currently available funds', self.broker.getcash())
print('Current total assets', self.broker.getvalue())
print('Current position', self.broker.getposition(self.data).size)
print('Current position cost', self.broker.getposition(self. ...
Added by cretam on Mon, 21 Feb 2022 13:19:58 +0200