AI Backtest

Backtest: Buy XOM at the close when its 20-day total return crosses above XLE's 20-day...

-6.62%
Return on capital

For a strategy built on a neat market narrative — XOM's 20-day return crossing above XLE's as a signal that supermajor leadership is about to persist — the backtest tells a different story. Running the rule on historical bars with $100,000 produced a -6.62% return across 27 closed trades, with a win rate just above 40%. Meanwhile, buy-and-hold SPY was up 68.30% over the same window.

The idea wasn't absurd on its face. Relative strength breakouts in energy leaders often look like early warnings for crude up-legs. But the numbers suggest the signal fired too often, and the 10-day holding cap or the 5-day exit rule didn't protect the downside. The full evidence — including the worst trade at -6.51% and the benchmark gap of nearly 75 points — is in the detailed analysis below.

The strategy

Buy XOM at the close when its 20-day total return crosses above XLE's 20-day total return; exit when its 5-day total return falls below XLE's 5-day total return or after 10 trading days, whichever comes first. Supermajor leadership rotates before crude up-legs, so a fresh relative-strength breakout above the energy sector tends to persist for a week or two.

How this was measured

This is a simulated backtest generated from the plain-English strategy below, executed bar-by-bar on historical market data using the price + news data mode with $100,000 starting capital. Strategy: Buy XOM at the close when its 20-day total return crosses above XLE's 20-day total return; exit when its 5-day total return falls below XLE's 5-day total return or after 10 trading days, whichever comes first. Supermajor leadership rotates before crude up-legs, so a fresh relative-strength breakout above the energy sector tends to persist for a week or two.

The key numbers

Return on capital
-6.62%
total P&L over starting capital
Total P&L
$-6,624.02
Closed trades
27
Win rate
40.7%
share of closed trades in profit
vs SPY
-74.93%
excess return over SPY buy-and-hold

The charts

Equity curve (growth of 100)

The takeaway

The strategy returned -6.62% on $100,000 starting capital across 27 closed trades with a 41% win rate. Over the same window SPY buy-and-hold returned +68.30%, so the strategy finished trailing the benchmark by 74.93 points. Best single trade +5.89%, worst -6.51%.

The fine print