XLE: three flat years, an Iran war spike, and a round trip in four months
The Market Wave Algorithm for ETFs against buy and hold and dollar cost averaging across three windows on the energy sector ETF.
The energy sector spent 2023 through 2025 going nowhere, then became the trade of 2026. Both stretches paid the same way: by trading them.
Energy pays the trader, not the holder
Energy is the sector investors buy for a reason, then regret for a decade. XLE spent three years between roughly $38 and $49, and a buy and hold position from January 2023 to January 2026 returned about six percent. Then came 2026. War with Iran pushed crude higher in March, XLE ran to a new high in early April, gave the whole rally back by late June, and then climbed to a fresh high in August.
That is two different problems in one ticker. A long sideways range that pays nothing for patience, and a geopolitical spike that punishes anyone who bought the headline. This study shows how one algorithm handled both, and a third window that let it trade the full stretch at a slower pace.
Trading the war
Strategy+48.2%
- Buy and hold
- +36.9%
- DCA
- +14.8%
Trading the range
Strategy+70.2%
- Buy and hold
- +6%
- DCA
- +1.2%
The patient trade
Strategy+102.8%
- Buy and hold
- +45.4%
- DCA
- +40.6%
All scenarios start from $100,000 cash and zero shares.
Backtested results. Past performance does not guarantee future results. For educational purposes only.
XLE, the energy sector in one ticker
XLE is the State Street Energy Select Sector SPDR ETF. It holds the energy names in the S&P 500, dominated by the integrated oil majors, and trades on NYSE Arca with deep liquidity. It is how most investors own oil without owning oil.
The recent history, in levels that matter:
- Early 2023XLE opens the year in the mid 40s after the 2022 energy run.
- 2023 through 2025The fund oscillates between roughly $38 and $49, touching the low end in mid 2023, early 2024, and spring 2025.
- January 2026Still in the mid 40s. Three years, no progress.
- March 2026War between Iran and the US and Israel begins, crude jumps, XLE breaks out.
- Early April 2026XLE peaks above $60 as the war peaks; a ceasefire is announced April 8.
- Late June 2026XLE falls back to about $54, below where it sat when the fighting started. The rally is erased.
- August 2026A second leg higher to above $64, then a pullback to about $62 by August 25.
Here is the catch that matters for this study. XLE rewarded no one for holding through 2023 to 2025, then rewarded almost no one for buying the 2026 headline. The gains in both stretches went to whoever bought the dips and sold the rips. Nearly nobody does that by hand.
Three ways the energy trade goes wrong
Range fatigue
Three years in a $38 to $49 box teaches you the fund does nothing. You stop watching. You hold through the fourth dip out of boredom and sell into the fifth out of disgust, usually right before it lifts.
Headline buying
War, crude spiking, analysts calling for $150 oil. You buy XLE in April 2026 near $60. By late June it is $54 and the ceasefire has held for ten weeks. The macro story was right and the trade still lost money.
The round trip
You bought early, rode the spike, watched the whole gain disappear by summer, and are now deciding whether the August leg is real. You have been right twice and paid once.
Dollar cost averaging deserves credit. It removes the timing decision and it kept buying through the flat years. But it buys blind, it never sells, and it never books a gain. Over 2023 to 2025 that discipline earned 1.2%. In 2026 it earned 14.8% while the fund rose 36.9%.
A rules-based algorithm restores the one thing every failure above lacks: a sell rule you decided before the headline arrived.
The algorithm
Ride confirmed moves
Entries wait for price to move a set percentage in the algorithm's favor before committing capital, so the algorithm buys weakness and confirms it.
Exit on rules, not nerves
Exits trigger at a preset profit threshold and, in two of these recipes, on a confirmed change of trend.
Step aside in chop
The Market Wave ribbon sets scope. Buy filters and sell filters keep the algorithm out of trades the ribbon does not support.
One algorithm, three recipes. The 2026 recipe is fast: tight entry and exit thresholds, near-full position sizing, a trend-break sell. The 2023 to 2025 recipe is built for a range: half-size entries, a wide scope of 13, and a rule to buy only below the ribbon. The weekly recipe is the patient one: wide 5.3% and 5.8% thresholds, full-size entries, one signal set per week. Same discipline, three different jobs.
Backtested results. Past performance does not guarantee future results. For educational purposes only.
“Trading the war”
January 1, 2026 to August 25, 2026 · Daily chart · The war recipe
2026 year to date: +48.2% through a war, a ceasefire, and a round trip
XLE began the year in the mid 40s. The war sent it above $60 by early April, the ceasefire and the reopening of Hormuz took it back to about $54 by late June, and a second leg carried it above $64 in August. Buy and hold caught the whole move and finished at +36.9%. Dollar cost averaging, buying monthly into a rising market, finished at +14.8%.
The strategy traded it: bought the March breakout, sold into the April peak, rebought the May and June dips, and rode the August leg.
+48.2%
- Buy and hold +36.9%, outperformance +11.3 percentage points
- DCA +14.8%, outperformance +33.4 percentage points
- Ending value
- $148,200
- Realized profit
- $31,657
- Unrealized profit
- $16,543
- Shares held
- 2,371 at $55.51 avg cost
- Cash
- $36
Backtested results. Daily chart, valued August 25, 2026. Past performance does not guarantee future results. For educational purposes only.
“Trading the range”
January 1, 2023 to January 1, 2026, valued at the window's end · Daily chart · The range recipe
2023 to 2025: +70.2% in three years the fund went nowhere
For three years XLE traded between roughly $38 and $49. Every rally faded near the top of the box and every selloff found buyers near the bottom. Buy and hold entered in the mid 40s and exited in the mid 40s: +6% for three years of patience. Dollar cost averaging did worse, +1.2%, because its buys averaged into the middle of the range.
The 2023 to 2025 recipe is built for a range: half-size entries, a wide scope of 13, and a rule to buy only below the ribbon.
+70.2%
- Buy and hold +6%, outperformance +64.3 percentage points
- DCA +1.2%, outperformance +69 percentage points
- Ending value
- $170,220
- Realized profit
- $62,810
- Shares held
- 3,781 at $42.75 avg cost
- Cash
- $1,172
Backtested results. Daily chart, window closed January 1, 2026. Past performance does not guarantee future results. For educational purposes only.
“The patient trade”
January 1, 2023 to August 25, 2026 · Weekly chart · The patient recipe
2023 to 2026 on the weekly chart: +102.8%, doubling the hold
This window covers everything: the three flat years and the 2026 war trade, on a weekly chart that produces a signal only when the week closes. Buy and hold finished at +45.4%, all of it earned in 2026. Dollar cost averaging finished at +40.6%.
The patient recipe used wide thresholds, full-size entries, and sold only above the ribbon. It bought the 2023 lows, sold the 2024 tops, bought the 2025 spring selloff, and sold most of the position into the 2026 highs.
+102.8%
- Buy and hold +45.4%, outperformance +57.5 percentage points
- DCA +40.6%, outperformance +62.2 percentage points
- Ending value
- $202,843
- Realized profit
- $100,439
- Unrealized profit
- $1,887
- Shares held
- 327 at $56.29 avg cost
- Cash
- $182,032
Backtested results. Weekly chart, valued August 25, 2026. Past performance does not guarantee future results. For educational purposes only.
Three windows, one discipline
| 2026 YTD, daily | 2023 to 2025, daily | 2023 to 2026, weekly | |
|---|---|---|---|
| Strategy return | +48.2% | +70.2% | +102.8% |
| Buy and hold | +36.9% | +6% | +45.4% |
| vs buy and hold | +11.3 pts | +64.3 pts | +57.5 pts |
| DCA | +14.8% | +1.2% | +40.6% |
| vs DCA | +33.4 pts | +69 pts | +62.2 pts |
| Ending value | $148,200 | $170,220 | $202,843 |
| Realized profit | $31,657 | $62,810 | $100,439 |
| Shares held | 2,371 | 3,781 | 327 |
| Average cost basis | $55.51 | $42.75 | $56.29 |
| Cash | $36 | $1,172 | $182,032 |
Backtested results. Past performance does not guarantee future results. For educational purposes only.
Same algorithm, three questions
Each window asked the algorithm a different question.
The 2026 window asked: can you trade a geopolitical spike without holding the round trip?
Answer: sell the April peak and buy the June low.
The 2023 to 2025 window asked: can a fund that goes nowhere still pay?
Answer: 3,781 shares at $42.75 and $62,810 realized.
The weekly window asked: can you do this slowly and still double?
Answer: $182,032 in cash near the highs.
Buy and hold and DCA each made one decision at the start and never revisited it. That works when the fund trends. It earned 6% and 1.2% when it did not.
The edge is not prediction. The edge is a sell rule that fires whether or not the story has changed.
Backtested results. Past performance does not guarantee future results. For educational purposes only.
What XLE teaches about every sector trade
- 01
A sideways market is a paycheck, not a waiting room
Three flat years paid 6% to the holder and 70.2% to the algorithm. Range-bound is where rules beat conviction by the widest margin.
- 02
The headline is not the trade
Buying the war in April 2026 lost money by June. Selling into it, on a rule set before the war, banked $31,657 and bought the dip.
- 03
Cash near the highs is a position
Ending the weekly window with $182,032 in dollars is not timidity. It is the algorithm doing its job while the holder hopes.
The client decision: what job do you want the algorithm doing on a sector you already believe in? Trading the range, trading the spike, or trading both at a weekly pace. The recipe follows the answer.
Backtested results. Past performance does not guarantee future results. For educational purposes only.
A path forward
Arch Public never holds your money. The Market Wave Algorithm for ETFs runs on your own brokerage account, on the recipe you chose, and you can change or stop it at any time. In this study the difference between holding XLE and trading it was $62,810 realized in three years the fund went nowhere, and $182,032 in cash near the 2026 highs.
Zero custody.
Full control.
Rules, not reactions.
If you own energy, the question is not whether oil goes higher. It is who sells for you when it does.
Buy and hold, 2023 to 2026, weekly
+45.4%
The Market Wave Algorithm for ETFs, 2023 to 2026, weekly
+102.8%
$100,439 banked as realized profit

The column to study is the middle one. Buy and hold earned 6% in three years. The algorithm earned 70.2% in the same three years on the same fund, because a range is not nothing to a system that sells the top of it and buys the bottom. The other two columns show the same discipline working when the fund finally moved.