Backtest PnL Attribution
Breaking a backtest's total profit and loss into pieces — which positions, which factors, which costs — so you know whether the strategy is working for the reason you think it is.
A backtest that reports "$2.4 million profit over three years" tells you the strategy made money, but not why. Maybe a handful of lucky trades in one sector drove the entire result and the rest of the book was flat or losing. Maybe the profit came from a broad market rally the strategy happened to be exposed to, not from any genuine stock-picking skill. PnL attribution splits the total profit into pieces — by position, by sector, by factor, by cost category — so a researcher can check whether the strategy is making money for the reason its thesis claims, rather than by accident.
Splitting the total
A basic attribution starts by separating gross trading profit from costs: commissions, slippage, financing charges, and borrow costs all eat into the headline number, and a strategy that looks profitable before costs can be a loser after them. On the profit side, attribution can go further and split by source of exposure — how much of the return came from the strategy's intended signal versus incidental exposure to the broad market, a sector, or a common risk factor like value or momentum the strategy never meant to bet on. A stock-picking strategy that turns out to have made most of its money from an accidental market-beta tilt during a bull run hasn't demonstrated the skill its designer thinks it has.
Worked example: three years, one strategy, one surprise
A long-short equity strategy reports $2.4 million in gross profit over three backtest years. Breaking it down: $1.8 million came from a single sector (energy) during an 18-month oil rally, $0.5 million from all other sectors combined, and $0.1 million net after subtracting $300,000 of commissions and borrow costs on short positions. The attribution reveals the strategy is really an energy-sector bet dressed up as a diversified long-short book — outside energy, three years of trading barely covered its own costs. That's a very different conclusion than "$2.4 million profit," and it changes how much confidence a researcher should place in the strategy generalizing to a period without an energy rally.
What this means in practice
PnL attribution is the difference between "this strategy made money" and "this strategy makes money for the reason we think." It's a standard step before allocating real capital, because a headline Sharpe ratio can hide a book that's actually a concentrated, undiversified bet, or one where costs are quietly eating most of the edge. Attribution also helps distinguish a genuinely broken strategy from one that's fine but was mismeasured — a strategy that looks flat overall but is consistently profitable outside one bad sector-quarter tells a different story than one that never made money anywhere.
Total backtest profit hides its own composition. Attributing it to sources — sector, factor exposure, costs — reveals whether a strategy's edge is real, broad, and repeatable, or a concentrated accident that happened to pay off once.
A strategy with an impressive aggregate Sharpe ratio can still be, underneath, a single concentrated bet that paid off. Skipping attribution and trusting the headline number is how researchers end up surprised when the strategy stops working the moment that one sector or factor turns.
Further reading
- Grinold and Kahn, Active Portfolio Management, ch. 17