Learn › Strategies › EMA 12/26 Trend › IEI

EMA 12/26 Trend on IEI

iShares 3-7 Year Treasury Bond ETF: shorter-duration Treasuries with milder swings. Backtest 2021-01-04 to 2026-10-02, $10,000 starting capital, computed by the same engine that runs live DeployQuant strategies.

Result: EMA 12/26 trend on IEI turned $10,000 into $10,509 (5.1% total, 0.9% CAGR): it beat buy-and-hold by 1.2% per year, with a maximum drawdown 9.6 points shallower than holding (4.2% vs 13.8%).

The EMA 12/26 trend rule bought IEI 20 times between 2021-04-23 and 2026-08-13 and turned $10,000 into $10,509. That is a CAGR of 0.87%. Buy-and-hold on the same fund ended at $9,793, a CAGR of -0.36%, so the rule finished ahead on both measures. Its maximum drawdown was 4.24%, against 13.8% for buy-and-hold.

IEI holds 3-7 year Treasuries, and its annualized volatility over the window was 4.57%. That leaves a 12/26 crossover very little to capture. The rule came out ahead because it stayed out of most of the 2022 decline. In 2022 buy-and-hold lost 9.3% and the rule lost 2.1%. In 2023, 2024 and 2025 the rule trailed buy-and-hold. One falling year explains the lead.

Among the 12 strategies on IEI, the EMA rule ranks 6th by CAGR. Trend plus trailing stop leads at 1.43%, the RSI(2) snapback follows at 1.42%, and the SMA 10/50 trend is third at 1.24%. Across the 59 funds this strategy ranks IEI 39th. Median CAGR for this rule is 2.76% across all 59 funds and 1.02% across bond funds, which puts IEI at 0.87% a little below the bond median. The strategy page has the other funds.

Limits of the test: a single 5.74 year window, one decision per day, no leverage, and a headline run with no fees or slippage. When long, the rule puts 98% of the account into the fund.

0.9%CAGR
−0.4%buy & hold CAGR
−4.2%max drawdown
0.30Sharpe ratio
20round trips
35%win rate
■ EMA 12/26 trend   ■ buy & hold, $10,000 invested 2021-01-04

Year by year

YearEMA 12/26 trendbuy & hold
2021−0.3%−2.5%
2022−2.1%−9.3%
20233.7%4.3%
2024−0.1%1.9%
20255.8%6.6%
2026−1.8%−2.4%

How each year played out

Three calendar years went to the rule (2021, 2022 and 2026) and three to buy-and-hold (2023, 2024 and 2025), with very different margins.

2021 was near flat for both. The rule lost 0.3% and buy-and-hold lost 2.5%. The rule made its first purchase on 2021-04-23 at $113.89, so it sat in cash for the first months of the year, and it ended up with five closed trades in 2021, two of them winners and all of them within about a percent of break-even. 2022 decided the result. The rule lost 2.1% while buy-and-hold lost 9.3%, and the fund's own calendar-year return was -9.54%. Two trades closed in 2022 and both lost, 1.13% from 2022-05-27 to 2022-06-03 and 1.23% from 2022-07-06 to 2022-08-22. The rest of the year the account was in cash, and the year's gap in the rule's favor was the largest of the six.

2023 gave buy-and-hold 4.3% and the rule 3.7%. The rule bought on 2022-11-15 at $101.86 and sold on 2023-02-13 for a 0.89% gain. It bought again on 2023-03-16 and lost 0.7% by 2023-05-23, then stood aside until 2023-11-06. That wait cost it little in the middle of the year and helped it keep pace by December.

In 2024 buy-and-hold made 1.9% and the rule lost 0.1%. The rule closed five trades that year and won two. The 2.4% gain from the 2023-11-06 entry came in February. Then three short trades lost 1.24%, 0.79% and 0.86%, each a crossover that reversed within about two weeks. The best trade of the whole test, 4.3% from 2024-05-10 to 2024-10-09, came in the same year, and it only recovered the earlier whipsaws.

2025 gave buy-and-hold 6.6% and the rule 5.8%. It was the year with the longest hold. The rule bought on 2025-06-02 at $112.07 and held to 2026-01-21 at $115.72, a 233-day trade and a 3.26% gain, the longest hold of the test. In 2026 the rule lost 1.8% and buy-and-hold lost 2.4%. After the January exit it took four more trades, each of which closed between flat and a 0.7% loss.

Across six years, the rule gave up a little in rising years and saved a lot in the single falling year. In the three years when the fund rose, 2023, 2024 and 2025, the rule trailed.

Month by month

YearJanFebMarAprMayJunJulAugSepOctNovDec
20210.0%0.0%0.0%−0.1%0.3%−0.1%0.6%−0.5%−0.4%0.0%0.0%−0.1%
20220.0%0.0%0.0%0.0%−0.5%−0.6%0.6%−1.8%0.0%0.0%0.7%−0.5%
20232.0%−1.3%−0.3%0.6%−1.1%0.0%0.0%0.0%0.0%0.0%1.4%2.3%
20240.3%−1.6%−1.3%−0.7%0.2%0.9%2.1%1.1%1.0%−1.2%0.0%−0.8%
20250.2%1.6%0.6%1.3%−1.4%1.2%−0.4%1.4%0.1%0.5%0.7%−0.2%
2026−0.3%1.1%−1.1%−0.4%0.0%−0.1%−0.2%−0.5%−0.2%0.0%––

What the zeros in the monthly table show

Many cells in the monthly table read 0.0%. A zero means the rule held no position that month. The rule was flat from January to March 2021, from January to April 2022, in September and October 2022, from June to October 2023, and in November 2024 and May 2026. The table maps when the rule stood aside.

The worst month was August 2022 at -1.76%, from the trade held between 2022-07-06 and 2022-08-22. Buy-and-hold's worst month was March 2022 at -3.04%, and the rule held no position for that month. The best month was December 2023 at 2.27%, after November 2023 at 1.42%. Both sit inside the 100-day trade that began on 2023-11-06 and closed on 2024-02-14 with a 2.4% gain. Buy-and-hold's best month was March 2023 at 2.83%. The rule only entered on March 16 that month and lost 0.26% over March.

The rule's losses came in brief runs. February, March and April 2024 gave -1.61%, -1.25% and -0.73%. In 2023 February lost 1.34% and May lost 1.06%. Its gains came in a few long holds. Three months made more than 2%: December 2023 at 2.27%, July 2024 at 2.12% and January 2023 at 2.05%. February 2025 made 1.63% and August 2025 made 1.42%.

A bond fund with 4.57% volatility moves little in a month, so the monthly figures are small on both sides. The rule held a position at the close on 50.2% of days.

Every trade

EMA 12/26 trend on IEI made 20 closed round trips, an average hold of 53 days, an average winner of 1.89%, an average loser of −0.61%, a profit factor of 1.65, a longest losing streak of 5. It held a position at the close on 50.2% of trading days.

EntryEntry priceExitExit priceReturnDays held
2021-04-23$113.892021-06-23$113.930.0%61
2021-07-07$114.382021-08-26$114.470.1%50
2021-09-01$114.842021-09-14$114.81−0.0%13
2021-09-15$114.762021-09-17$114.36−0.3%2
2021-12-21$113.022021-12-28$112.93−0.1%7
2022-05-27$106.362022-06-03$105.16−1.1%7
2022-07-06$106.182022-08-22$104.87−1.2%47
2022-11-15$101.862023-02-13$102.770.9%90
2023-03-16$105.132023-05-23$104.37−0.7%68
2023-11-06$102.672024-02-14$105.132.4%100
2024-03-08$106.502024-03-18$105.18−1.2%10
2024-03-27$105.942024-04-03$105.10−0.8%7
2024-05-10$105.212024-10-09$109.734.3%152
2024-12-04$109.112024-12-19$108.17−0.9%15
2025-01-28$108.892025-05-15$111.372.3%107
2025-06-02$112.072026-01-21$115.723.3%233
2026-02-06$116.492026-03-16$116.44−0.0%38
2026-04-16$116.502026-04-30$116.03−0.4%14
2026-06-25$116.132026-07-14$115.66−0.4%19
2026-08-13$116.002026-09-02$115.21−0.7%20

Prices are adjusted for splits and dividends, so they sit below the quotes printed at the time. An open position is marked at the last close.

The 20 trades

The rule closed 20 round trips with an average hold of 53 days and a median hold of 38 days. Seven were winners, a win rate of 35%. The average winner made 1.89% and the average loser lost 0.61%, giving a profit factor of 1.65. The median trade returned -0.08%. This is a rule that loses often by small amounts and wins rarely by larger ones, which is what trend following looks like on a fund that rarely trends.

The run of consecutive losers peaked at 5 trades, and the run of winners at 2. The losing streak ran from the 2021-09-01 entry, which lost 0.03%, through 2021-09-15 at -0.35%, 2021-12-21 at -0.08%, 2022-05-27 at -1.13% and 2022-07-06 at -1.23%. It ended with the 0.89% gain entered on 2022-11-15. The two winners in a row were the first two trades of the test, at 0.04% and 0.08%. The best winners were 4.3%, 3.26%, 2.4%, 2.28% and 0.89%.

The best trade ran 152 days from 2024-05-10 at $105.21 to 2024-10-09 at $109.73. The second was the 233-day trade from 2025-06-02. The third ran 100 days from 2023-11-06 at $102.67 to 2024-02-14 at $105.13. The four best trades were long. The shortest trade lasted 2 days, from 2021-09-15 to 2021-09-17, and lost 0.35%. A fast average such as the 12-day one flips on small moves in a low-volatility fund, so the short trades came from noise.

The worst trade, -1.24%, came from 2024-03-08 to 2024-03-18 at $106.50 and $105.18, a 10-day hold. The next worst was -1.23% in 2022 and the third -1.13%. No single trade lost more than about a percent and a quarter. That is the benefit of a rule on a low-volatility fund: nothing in the trade list is large in either direction. Fill prices in the trade table are adjusted for splits and dividends, which makes them lower than the quotes of the day.

Which big days the crossover caught and which it missed

The fund's five best days all fell in 2022 and 2023: 1.45% on 2022-11-10, 1.37% on 2022-09-28, and three days in March 2023 at 1.2%, 1.16% and 1.12%. The rule held none of them. It was flat on 2022-09-28, and it bought on 2022-11-15 at $101.86, a few sessions after the best day of the window. It entered on 2023-03-16, the day after the last of the three March days. A crossover waits for the average to turn, so it arrives after the first bounce, and on this fund the biggest single-day gains came as sharp reversals inside a downtrend.

The worst days split the other way. The rule was out of the fund on 2022-06-13 (-1.09%), on 2022-03-02 (-0.91%) and on 2024-04-10 (-0.98%), having sold on 2022-06-03 and 2024-04-03. It was long through 2022-08-02 (-0.92%) and 2022-08-05 (-0.97%), two of the days that produced the 1.76% loss in August 2022. The exit signal removed three of the five worst days and the rule paid for the other two.

Trades by exit year show where the wins sat. 2021 closed 5 round trips with 2 wins, 2022 closed 2 with none, 2023 closed 2 with 1, 2024 closed 5 with 2, 2025 closed 1 with 1, and 2026 closed 5 with 1. The four largest winners all closed between 2024-02-14 and 2026-01-21. The 2025 year had a single trade and a 5.8% rule return, the cleanest year of the six.

Largest drawdowns

PeakLow pointDepthDays to lowRecoveredDays to recover
2024-02-012024-05-29−4.2%1182024-08-0265
2021-08-032022-07-20−3.7%3512023-12-20518
2024-09-162025-02-12−2.8%1492025-04-0350

Buy-and-hold's deepest drawdown ran from 2021-01-04 to 2022-10-20 and reached −13.8%.

Drawdowns of the rule and of the fund

The rule's deepest drawdown was 4.24%, from a peak on 2024-02-01 to a low on 2024-05-29, 118 days later. It recovered on 2024-08-02, 65 days after the low. The second was 3.74%, from 2021-08-03 to 2022-07-20, which took 351 days to reach the low and 518 more days to recover, by 2023-12-20. The third was 2.82%, from 2024-09-16 to 2025-02-12, recovered on 2025-04-03 after 50 days.

Two things stand out. The deepest drawdown came in 2024, a year when the fund itself made money, because the rule bought into short rallies that reversed in February to April. The 2021 to 2023 drawdown was long but shallow: it took more than a year and a half to recover and never exceeded 3.74%.

Buy-and-hold's worst drawdown ran from 2021-01-04 to 2022-10-20 and reached 13.8%. The slide to the low took 654 days, and the recovery came on 2025-10-16, 1,092 days in. Another drawdown opened on 2026-02-27, hit 3.88% by 2026-09-28, and was still open when the data ended. Measured on the fund's price series alone, the deepest drawdown was 14.21% across those dates and the longest lasted 1,201 sessions.

The drawdown lead is large: 4.24% against 13.8%. A holder of IEI was under water for a long stretch of the window. The rule spent part of it in cash and was under water for far less, though its CAGR of 0.87% is close to flat.

With trading costs

The headline run fills at the bar price. These runs charge slippage on every fill.

Slippage per fillCAGRMax drawdownFinal valueSharpe
None (headline)0.9%−4.2%$10,5090.30
5 basis points0.5%−4.5%$10,3040.19
10 basis points0.2%−5.4%$10,1030.07

What slippage does to a 0.87% CAGR

The headline run fills at the bar price. The cost runs charge slippage on every fill. At 5 basis points the CAGR falls to 0.52%, the maximum drawdown rises to 4.52%, the final value is $10,304 and the Sharpe ratio is 0.19. At 10 basis points the CAGR is 0.18%, the drawdown 5.44%, the final value $10,103 and the Sharpe ratio 0.07.

The rule makes 40 fills over the window. Each is charged the slippage, so the costs add up even though each fill moves the price a fraction of a percent. A 0.87% annual return is small to begin with, and 10 basis points of slippage takes most of it. The Sharpe ratio goes from 0.30 to 0.07.

At 10 basis points the rule still ends above buy-and-hold's $9,793 and its drawdown is still shallower than 13.8%. That does not make it attractive for a real account. A return that close to zero is within the range that fees, spreads and taxes could erase.

Changing the parameters

VersionCAGRMax drawdownRound tripsWin rateFinal value
Published rules0.9%−4.2%2035%$10,509
EMA 8/210.7%−5.5%3225%$10,423
EMA 20/500.9%−5.2%1127%$10,531
EMA 12/500.9%−4.2%1331%$10,502

Changing the parameters

Three variants were run against the published 12/26 setting. EMA 8/21 is faster and made 32 trades, with 8 winners. It returned 0.72% with a drawdown of 5.52% and ended at $10,423. EMA 20/50 is slower and made 11 trades, with 3 winners, returning 0.9% with a drawdown of 5.24% and a final value of $10,531. The third variant, EMA 12/50, leaves the fast average alone and stretches the slow one. It made 13 trades, returned 0.86%, had a 4.17% drawdown and ended at $10,502.

The CAGRs are close together. The published rule returned 0.87%, and the slower variants returned 0.9% and 0.86%. A slower pair made fewer trades without hurting the return, which is what a fund with low volatility would be expected to favor. The faster 8/21 pair made more trades and returned less, and its drawdown was the deepest of the four at 5.52%.

The results do not depend on one exact setting. All four versions beat buy-and-hold's -0.36% CAGR, and all four had drawdowns far below 13.8%. That consistency says the rule's edge here comes from its being a trend filter on a fund that fell. It does not say the rule has a special setting.

How IEI behaved

MeasureIEI
Data in this test2021-01-04 to 2026-10-02 (1444 sessions)
Total return, buy and hold−2.3%
Annualized volatility4.6%
Deepest drawdown−14.2% (2021-01-04 to 2022-10-20)
Up days48.2%
Average daily range0.25%
Average overnight gap0.16%
Correlation to SPY0.08
Correlation to QQQ0.09
Correlation to TLT0.80
Sessions above the 200-day average59.2%
Crossings of the 200-day average42
Falls of 10% or more from a 20-day high0

How IEI behaved

IEI returned -2.25% over the window with annualized volatility of 4.57%. It rose on 48.23% of sessions, with an average up day of 0.22% and an average down day of -0.21%. The average daily range was 0.25% and the average overnight gap 0.16%. Its best day was 1.45% on 2022-11-10 and its worst was -1.09% on 2022-06-13. The fund never fell 10% from a 20-day high at any point.

By calendar year the fund returned -2.55% (2021), -9.54% (2022), 4.43% (2023), 1.92% (2024), 6.83% (2025) and -2.48% (2026, partial). The overnight part of the return was 4.78% in log terms and the intraday part was -6.95%, so the fund gained overnight and lost during the trading day.

The fund moves with other bonds, not stocks. Its correlation to SPY was 0.08 and to QQQ 0.09, while its correlation to TLT was 0.8. It was most correlated with IEF at 0.97, AGG at 0.94 and BND at 0.94, and least correlated with TBF at -0.8. Beta to TLT was 0.24.

For trend rules the key figures are the 200-day statistics. The fund sat above its 200-day average for 59.2% of sessions and crossed that line 42 times. Forty-two crossings in 5.74 years is a lot for a fund that barely moved, and it explains the clusters of short trades. RSI(14) dipped under 30 on 64 sessions. Five days later the median return was -0.11%, and after 20 days it was -0.65%. The baseline medians over all sessions were -0.03% and 0.04%. Oversold readings did not bounce on this fund. They tended to be followed by more weakness, which fits a fund in a persistent downtrend.

By calendar month, November averaged 1.32% and September -0.98% and October -0.72%, each from 5 or 6 years. Day-of-week averages were all within 0.04% of zero. Median minute volume was 1,292 shares, which is thin for minute-bar fills.

The rules

Hold while the 12-day exponential average is above the 26-day, the core of the MACD used as a position switch.

  1. WHEN the market opens · IF not invested AND EMA(12) > EMA(26) · THEN buy with 98% of the sleeve
  2. WHEN the market opens · IF invested AND EMA(12) < EMA(26) · THEN sell the whole position

The 12/26 exponential moving average pair is the core of the MACD indicator. Exponential averages weight recent days more than simple averages, so this crossover reacts faster than an SMA pair of the same length. Used as a long/flat switch, it gives you a position you can hold and measure.

Good for: traders who like MACD logic but want it expressed as a simple, testable long/flat rule.
Watch out: faster reaction means more trades and more whipsaws than a 50/200 cross; check the trade count on each backtest page.

What a crossover does on a quiet bond fund

Entry happens at the open once the 12-day exponential average sits over the 26-day one. The full position is sold at the open when the order flips. Because exponential averages give recent days extra weight, this crossover turns sooner than a simple-average pair with the same lengths. On a fund that rose and fell slowly, it produced long holds in clean trends and short, losing holds in the choppy stretches in between.

On the same crossover, SGOV returned 3.21% with 17 trades, IGIB 2.35% with 20, AGG 1.07% with 22 and BND 1.02% with 22. IEI returned 0.87% with 20. The longer-duration funds did worse: IEF lost 0.39% with a drawdown of 10.63%, and TLT lost 0.67% with a drawdown of 15.92%. IEI sits in the middle of that range.

The strategy's own notes say that faster reaction means more trades and more whipsaws than a slower cross, and the trade list supports that: many of the 20 trades lasted under three weeks. The other strategies on this fund show different trade-offs. The golden cross returned 1.09% with a drawdown of 5.51%, and the 200-day regime filter returned 1.03% with 4.62%. The SMA 10/50 trend had the shallowest drawdown of the trend rules at 3.21%. Monthly cycle lost 0.84% with a 15% drawdown, close to buy-and-hold.

Taken together, IEI is a fund where trend rules protected capital and earned little. All 12 strategies on IEI are ranked on its fund page. The tests have limits: one window, daily decisions, no margin, 98% sizing, and no tax or fee modelling beyond the two slippage runs.

The 2026 whipsaw run and the September 2021 flip

The most recent stretch shows the weakness of the rule in its plainest form. After the 3.26% trade closed on 2026-01-21, the rule entered five more times. The entry on 2026-02-06 at $116.49 exited on 2026-03-16 at $116.44, a 0.04% loss. Then came -0.4% from 2026-04-16 to 2026-04-30, another -0.4% from 2026-06-25 to 2026-07-14, and -0.68% from 2026-08-13 to 2026-09-02. Entry prices sat between $116 and $116.50 each time, so the fund spent months in a narrow band and the averages crossed back and forth inside it.

A similar flip appears in September 2021. The rule sold on 2021-09-14 at $114.81, bought again on 2021-09-15 at $114.76, and sold on 2021-09-17 at $114.36. The second of those trades was the shortest of the test, 2 days and -0.35%. In both episodes the fund traded within a few tenths of a percent of its entry, and a two-line rule has no way to tell a pause from a reversal.

The fund's RSI(2) record shows the same lack of edge for a mean-reverting setup. RSI(2) fell below 10 on 183 sessions, and the median return five days later was -0.04% against a baseline of -0.03%. Twenty days later it was -0.02% against 0.04%. Those are tiny gaps. The RSI(2) snapback still ranked second on this fund at 1.42% CAGR, ahead of this crossover's 0.87%, with opposite logic.

Run EMA 12/26 trend on IEI yourself, free →

Build it from blocks (or type it in English), backtest it on 5.7 years of minute data in seconds, tweak any parameter, then paper trade it on live data. No card, no broker needed to start.

Frequently asked questions

Did EMA 12/26 trend beat buy-and-hold on IEI?

Over 2021-01-04 to 2026-10-02, EMA 12/26 trend on IEI returned 0.9% annualized vs −0.4% for buy-and-hold: it beat buy-and-hold by 1.2% per year, with a maximum drawdown 9.6 points shallower than holding (4.2% vs 13.8%).

How many trades did it make?

20 completed round trips over 5.7 years (40 fills), with 35% of round trips closing profitably.

Is this the same as trading MACD signals?

It uses the MACD's underlying trend component. Classic MACD trades the signal-line crossover of the 12/26 spread. This template trades the spread's sign directly, which is simpler and can be built fully in blocks.

Did the EMA 12/26 trend rule beat buy-and-hold on IEI?

Yes. The rule returned 0.87% a year and ended at $10,509, while buy-and-hold returned -0.36% and ended at $9,793. The drawdown was 4.24% against 13.8%. Most of the lead came from 2022, when the rule lost 2.1% and buy-and-hold lost 9.3%.

How many trades did the rule make on IEI?

It made 20 round trips and 40 fills between 2021-04-23 and 2026-09-02. Seven were winners, a win rate of 35%. The average hold was 53 days and the longest was 233.

How much of the result survives slippage?

At 5 basis points per fill the CAGR was 0.52% and the final value $10,304. At 10 basis points it was 0.18% and $10,103. The drawdown rose to 5.44% in the 10 basis point run.

Does a slower EMA pair work better on IEI?

Slightly. EMA 20/50 returned 0.9% with 11 trades, and EMA 12/50 returned 0.86% with 13. The faster 8/21 pair returned 0.72% with 32 trades. The spread is small and all variants beat buy-and-hold.

What was the rule's worst stretch on IEI?

The deepest drawdown was 4.24%, from 2024-02-01 to 2024-05-29, and it recovered by 2024-08-02. The worst single trade lost 1.24% from 2024-03-08 to 2024-03-18. Buy-and-hold's worst drawdown was 13.8%.

Which strategy did best on IEI?

Trend plus trailing stop had the highest CAGR at 1.43%, followed by the RSI(2) snapback at 1.42%. The EMA 12/26 rule ranked 6th of 12 at 0.87%. SGOV had the best result among bond funds for this rule at 3.21%.

Related

EMA 12/26 Trend on all 59 ETFsfull results table All strategies on IEI12 templates compared RSI(14) Mean Reversion on IEIsame ETF, different rulesRSI(2) Dip Snapback on IEIsame ETF, different rules

Backtests are hypothetical, computed by DeployQuant's engine on minute-resolution consolidated US market data (2021-01-04 to 2026-10-02, $10,000 starting capital, no margin, no fees or slippage in the headline run; buy-and-hold puts 98% of the account in at the first open, as the templates do) and do not guarantee future results. Nothing on this page is investment advice. Live trading involves risk of loss.