Problem with Backtrader?
By the end of the backtest it starts selling without buying and the profit goes to the moon.
Some of the orders... see how the profit is wrongly calculated.
2021-02-06, BUY CREATE, 0.45
2021-02-06, BUY EXECUTED, Price: 0.45, Cost: 200.40, Comm 0.00
2021-02-06, SELL CREATE, 0.45
2021-02-06, SELL EXECUTED, Price: 0.45, Cost: 200.40, Comm 0.00
2021-02-06, OPERATION PROFIT, GROSS 1.52, NET 1.52
vladisld last edited by
@foxbearbear it would help if you could share your code.
Looks like your strategy opens a lot of short positions at the end of the backtests. Highly likely it is not a problem of
bt, but bug in the strategy script.