Equity Curves and P&L Accounting for Pairs Trading Backtests
Summary
This article explains how to build vectorized equity curves while distinguishing long-only return calculations from long-short pair-trading P&L. For a single asset or a long-only portfolio with positive value, it recommends calculating portfolio returns and multiplying them by the position held for each period, with careful timing to avoid look-ahead bias. Portfolio returns should be calculated after combining component values, rather than by linearly combining their returns.
For a long-short spread that can cross zero, the article instead constructs a hedged portfolio value, takes its daily price difference as unit P&L, multiplies by the strategy position, and cumulatively sums the result. Dollar-neutral trades can be handled by calculating daily P&L from the long and short units; this may be described informally as return-like, but the invested principal is not a defined dollar amount. The examples are simplified sanity checks: they omit transaction costs, market impact, slippage, and other frictions, and the author cautions that backtests can encourage false discoveries.
Key ideas
- Use compounded returns for single assets and long-only portfolios with positive values.
- Calculate portfolio returns from the combined portfolio value, not by combining component returns directly.
- For long-short spreads that may cross zero, compute daily P&L from price changes and sum position-weighted P&L.
- Dollar-neutral P&L is not a conventional return because the notional used is an arbitrary bound rather than defined principal.
- Treat vectorized equity curves as simplified checks and account for timing to avoid look-ahead bias.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.