AI Backtest

Backtest: Buy XLE at the close when XLE crosses above its 20-day simple moving average...

29.20%
Return on capital

A crude-confirmed break back above trend in energy equities sounds like the kind of setup that should pay. Tested properly, it does make money — just not much of it relative to simply holding the index.

The rules are simple enough to state in a sentence: buy XLE when it closes above its 20-day moving average with Brent above its own, exit on a close below the 5-day or after ten sessions. Across 19 closed trades the strategy returned +29.20% on $100,000, winning 57.9% of the time, with a best trade of +6.79% and a worst of -2.20%.

The problem is the comparison. SPY buy-and-hold returned +85.28% over the same window, leaving the strategy 56.08 points behind. The setup works; the timing just gives up too much. The full trade-by-trade evidence is below.

The strategy

Buy XLE at the close when XLE crosses above its 20-day simple moving average while Brent crude closes above its 20-day simple moving average; exit when XLE closes below its 5-day simple moving average or after 10 trading days, whichever comes first. A crude-confirmed trend break in energy equities tends to persist, so buying the first close back above trend with Brent also bid catches the sector's continuation move.

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 XLE crosses above its 20-day simple moving average while Brent crude closes above its 20-day simple moving average; exit when XLE closes below its 5-day simple moving average or after 10 trading days, whichever comes first. A crude-confirmed trend break in energy equities tends to persist, so buying the first close back above trend with Brent also bid catches the sector's continuation move.

The key numbers

Return on capital
29.20%
total P&L over starting capital
Total P&L
$29,200.36
Closed trades
19
Win rate
57.9%
share of closed trades in profit
vs SPY
-56.08%
excess return over SPY buy-and-hold

The charts

Equity curve (growth of 100)

The takeaway

The strategy returned +29.20% on $100,000 starting capital across 19 closed trades with a 58% win rate. Over the same window SPY buy-and-hold returned +85.28%, so the strategy finished trailing the benchmark by 56.08 points. Best single trade +6.79%, worst -2.20%.

The fine print