AI Backtest

Backtest: Buy XLE at the close when the XLE/SPY ratio closes at a 20-day low while Bren...

3.60%
Return on capital

A 67% win rate normally reads as a working edge. Here it didn't. Thirteen signals produced a +3.60% return on $100,000 while SPY buy-and-hold ran far ahead — the sort of gap that makes a high hit rate look like a distraction rather than an achievement.

The setup itself is a familiar squeeze. Buy XLE when energy equities close at a 20-day relative low against the S&P 500, but only while Brent crude is still above its 50-day average. The idea: the sector gets flushed on positioning even though the oil tape hasn't broken, so it snaps back once crude reasserts. The exit is deliberately short-leashed — out when the XLE/SPY ratio closes back above its 5-day average, or after five sessions.

Whether that snapback actually pays is the question the backtest answers, and the trade-level detail below is where the interesting part lives.

The strategy

Buy XLE at the close when the XLE/SPY ratio closes at a 20-day low while Brent crude closes above its 50-day simple moving average; exit when the XLE/SPY ratio closes above its 5-day simple moving average or after 5 trading days, whichever comes first. Energy equities making relative lows against the broad market while oil holds an uptrend signals a sector positioning flush, so XLE tends to snap back once the oil tape reasserts.

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 XLE at the close when the XLE/SPY ratio closes at a 20-day low while Brent crude closes above its 50-day simple moving average; exit when the XLE/SPY ratio closes above its 5-day simple moving average or after 5 trading days, whichever comes first. Energy equities making relative lows against the broad market while oil holds an uptrend signals a sector positioning flush, so XLE tends to snap back once the oil tape reasserts.

The key numbers

Return on capital
3.60%
total P&L over starting capital
Total P&L
$3,603.41
Closed trades
13
Win rate
66.7%
share of closed trades in profit
vs SPY
-72.73%
excess return over SPY buy-and-hold

The charts

Equity curve (growth of 100)

The takeaway

The strategy returned +3.60% on $100,000 starting capital across 13 closed trades with a 67% win rate. Over the same window SPY buy-and-hold returned +76.34%, so the strategy finished trailing the benchmark by 72.73 points. Best single trade +2.77%, worst -6.78%.

The fine print