(values: list[float])
| 244 | + float(cfg["slippage_vol_mult"]) * bar_vol * pipeline.TRADING_DAYS_PER_YEAR**0.5 * 1e-3 |
| 245 | ) |
| 246 | total_cost = turnover * cost_per_turn |
| 247 | gross_total_return = backtest["equity"][-1] - 1.0 |
| 248 | net_total_return = gross_total_return - total_cost |
| 249 | |
| 250 | # Charge each bar for the position change into it, so the charges sum to total_cost. |
| 251 | net_returns = [ |
| 252 | r - (abs(positions[i] - positions[i - 1]) * cost_per_turn if i > 0 else 0.0) |
| 253 | for i, r in enumerate(strategy_returns) |
| 254 | ] |
no outgoing calls
no test coverage detected