Skip to content
All library documents

Trade-Level P&L and Drawdown Analysis for a Turtle Strategy Backtest

Notebook Quant course library

Summary

The document presents a workflow for evaluating individual trades from a Turtle-style strategy backtest on an hourly Bitcoin instrument. It configures a backtest with a historical date range, fees, slippage, contract size, tick size, and starting capital, then reconstructs completed trade outcomes from the engine’s trade records. Position changes are accumulated until exposure returns to zero, at which point the workflow records trade duration, turnover, volume, and gross result.

It estimates net P&L by subtracting commission and slippage, then derives cumulative balance, log returns, peak-to-trough drawdown, and drawdown percentage. It also separates long and short outcomes and reports measures such as win rate, average P&L, average holding time, and win-to-loss size. Charts show balance, per-trade P&L, and its distribution. The document gives implementation logic rather than computed findings, so it supplies no evidence that the strategy is profitable. Results depend on cost assumptions and trade-direction handling, and the method’s treatment of partial closes or reversals would need careful validation.

Key ideas

  • Trade records can be grouped into completed trades by tracking net position until it returns to zero.
  • Trade-level gross P&L is adjusted for estimated commissions and slippage to obtain net P&L.
  • Cumulative net results support balance and drawdown calculations.
  • Long and short trades can be analyzed separately using win rates, average outcomes, and holding durations.
  • The workflow defines metrics and plots but does not report backtest results.

Tags

From a private course collection; the original is not published.