Fees are set with cerebro.broker.setcommission(commission=0.001): here 0.1% of the amount of each order, on buys as well as sells.
A round trip (buy then sell) therefore pays fees twice. At 0.1% per order, a position must gain more than 0.2% just to cover its fees.
Fees are not the only cost: slippage, the gap between expected and obtained price, comes on top. Backtrader simulates it for example with cerebro.broker.set_slippage_perc(0.0005), i.e. 0.05%.
In notify_trade(), trade.pnl is the gross result and trade.pnlcomm the result net of commissions: compare them to see what your fees cost.
Examples
FRAIS-X (fictional market) : Each rectangle groups 5 bars. A strategy that trades every bar places 5 orders where another places just one: for the same price move, its fees are 5 times heavier.
“Trading Is Hazardous to Your Wealth” (2000) : In this study, Brad Barber and Terrance Odean analysed tens of thousands of US retail accounts. The households that traded the most earned net returns clearly below the market, largely because of transaction costs.
Key terms
Commission
Fee paid to the broker on each order
Round trip
A buy followed by the matching sell
Slippage
Gap between the expected price and the price actually obtained