Learn › Strategies › EMA 12/26 Trend › IGIB

EMA 12/26 Trend on IGIB

iShares 5-10 Year Investment Grade Corporate Bond ETF: investment-grade corporate credit. 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 IGIB turned $10,000 into $11,424 (14.2% total, 2.4% CAGR): it beat buy-and-hold by 2.1% per year, with a maximum drawdown 14.8 points shallower than holding (5.3% vs 20.1%).

The EMA 12/26 trend rule bought IGIB 20 times between 2021-01-04 and 2026-10-02 and turned $10,000 into $11,423.61. That is a CAGR of 2.35%, a total return of 14.24% and a maximum drawdown of 5.33%. Buy-and-hold on the same fund over the same dates returned 0.21% a year, ended at $10,121.16 and fell 20.13% at its worst. The rule had a Sharpe ratio of 0.59, and buy-and-hold had 0.07.

IGIB is an iShares fund of 5 to 10 year investment-grade corporate bonds. A bond fund that fell in 2021 and 2022 and then recovered slowly is the situation a long/flat switch is built for. The rule holds the fund while the 12-day exponential average sits above the 26-day and sells everything when it drops below. It was invested 56.1% of the time, so it spent close to half the window in cash.

The result ranks first of the 12 strategies on IGIB by CAGR. That ranking is a narrow one. The next best, the golden cross, returned 1.84%, and the SMA 10/50 trend returned 1.73%. Across all 59 funds the EMA 12/26 rule's median CAGR was 2.76%, and IGIB's 2.35% puts it 32nd of 59 for this rule. In its own category of seven bond funds the median was 1.02%, so IGIB did better than most bond funds, and the cash-like SGOV did better still at 3.21%.

The rule won 7 of its 20 round trips, a win rate of 35%. It made money because the wins averaged 3.43% and the losses averaged -0.75%, a profit factor of 2.36. Most of the 20 trades were small losses taken while the fund went sideways, and three long trends paid for them.

All figures are hypothetical. The window is one stretch of 5.74 years, the headline run has no fees or slippage, and the rule makes one decision a day at the open.

2.4%CAGR
0.2%buy & hold CAGR
−5.3%max drawdown
0.58Sharpe 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
20211.3%−1.6%
20221.5%−13.6%
20237.3%8.9%
20241.5%3.4%
20254.7%9.3%
2026−2.5%−3.3%

How each year played out against buy-and-hold

The rule beat buy-and-hold in three of the six calendar years: 2021, 2022 and 2026. It lost to buy-and-hold in 2023, 2024 and 2025. The three it won were years when the fund fell, and the three it lost were years when the fund rose.

In 2021 the rule returned 1.3% against -1.6% for buy-and-hold. The first trade opened on 2021-02-11 and closed five days later at a loss of 0.63%. The one good trade of the year ran from 2021-04-19 to 2021-09-27 for 2.37% over 161 days. A third entry on 2021-11-10 lasted a single day and lost 0.43%.

2022 is where the rule earned its place. IGIB fell 13.97% as a fund that year, and buy-and-hold lost 13.6%. The rule returned 1.5%. It exited a December 2021 position on 2022-01-05 for a small loss of 0.49%, then stayed in cash until 2022-07-18. That entry closed on 2022-08-25 for 0.40%, and the next, opened on 2022-11-14 at an adjusted price of 41.26, ran to 2023-02-16 for 3.37%. In between the rule sat out the heaviest months of the drawdown. The monthly table shows 0 for every month from 2022-02 to 2022-06 and again for 2022-09 and 2022-10.

In 2023 the rule returned 7.3% against 8.9% for buy-and-hold. Four round trips closed that year, two of them wins. The long trade from 2023-11-08 was the best of the whole window. 2024 gave 1.5% against 3.4%. The rule held a 156-day trade from 2024-05-08 to 2024-10-11 for 6.00%, and two losing trades, 1.23% in March and 1.91% in December, took part of it back.

2025 is the largest shortfall. Buy-and-hold returned 9.3% and the rule returned 4.7%. The fund's worst-day list includes 2025-04-07 at -1.43%. The rule exited on 2025-04-11 for -0.75%, re-entered on 2025-04-29 and held to 2025-11-17 for 5.37%. The days in cash between the exit and the re-entry cost part of that rise. 2026 runs to 2026-10-02: the rule returned -2.5% against -3.3% for buy-and-hold. Five round trips closed in 2026 and none were wins.

Month by month

YearJanFebMarAprMayJunJulAugSepOctNovDec
20210.0%−0.6%0.0%0.3%0.6%1.1%1.1%−0.3%−0.6%0.0%−0.4%0.0%
2022−0.5%0.0%0.0%0.0%0.0%0.0%2.7%−2.2%0.0%0.0%2.2%−0.7%
20234.2%−2.4%1.2%0.7%−1.6%0.4%−1.2%−1.1%0.0%0.0%3.1%4.0%
20240.0%−1.1%0.3%−1.5%0.5%0.7%2.5%1.6%1.6%−1.2%0.0%−1.9%
2025−0.1%1.9%0.0%−2.4%0.4%1.8%0.1%1.3%1.2%0.3%0.1%−0.1%
20260.2%1.3%−1.8%−0.4%−0.6%0.1%−0.8%−0.5%−0.2%0.0%––

Months in cash and months with a loss

The monthly table has many zeros. A month shows 0 when the rule was in cash the whole month, and the window contains many of them, mostly in 2022 and in the first half of 2021. The best month was 2023-01 at 4.2%, and the worst was 2023-02 at -2.4%. The two are adjacent. The rule captured the January rally, held through the February reversal, and exited on 2023-02-16.

A fast crossover on a low-volatility fund produces that pattern. IGIB's annualized volatility was 6.29%, and its typical day moved 0.3% in either direction. The 12-day average sits very close to the 26-day average in a fund that moves so little, so small reversals flip the signal. The monthly numbers from mid-2023 show it. July 2023 lost 1.22%, August 2023 lost 1.08%, and the two short trades from 2023-06-29 and 2023-07-17 lasted 7 and 18 days.

December 2023 returned 4.03% and November 2023 returned 3.08%, which together were the base of the best trade. Other good months were 2022-07 at 2.69%, 2022-11 at 2.23%, 2024-07 at 2.53%, 2024-08 at 1.64% and 2025-02 at 1.93%. The losing months cluster in the weeks after a signal change, for example 2024-12 at -1.86%, 2025-04 at -2.38% and 2026-03 at -1.75%.

The fund's own calendar has a strong seasonal tilt in these six years. November averaged 2.58% and September averaged -1.44%. Each month has five or six observations, so the averages come from very few years, and the rule's own results do not trace them closely.

Every trade

EMA 12/26 trend on IGIB made 20 closed round trips, an average hold of 59 days, an average winner of 3.43%, an average loser of −0.75%, a profit factor of 2.36, a longest losing streak of 5. It held a position at the close on 56.1% of trading days.

EntryEntry priceExitExit priceReturnDays held
2021-02-11$49.332021-02-16$49.02−0.6%5
2021-04-19$48.022021-09-27$49.162.4%161
2021-11-10$48.992021-11-11$48.78−0.4%1
2021-12-14$48.732022-01-05$48.49−0.5%22
2022-07-18$42.832022-08-25$43.000.4%38
2022-11-14$41.262023-02-16$42.653.4%94
2023-03-20$43.132023-05-18$43.250.3%59
2023-06-29$43.282023-07-06$42.85−1.0%7
2023-07-17$43.572023-08-04$43.16−0.9%18
2023-11-08$42.632024-02-15$45.276.2%99
2024-03-06$45.592024-04-11$45.03−1.2%36
2024-05-08$45.372024-10-11$48.096.0%156
2024-12-03$48.232024-12-19$47.31−1.9%16
2025-01-29$47.772025-04-11$47.41−0.8%72
2025-04-29$48.772025-11-17$51.395.4%202
2025-11-25$51.832026-03-13$51.79−0.1%108
2026-04-14$52.172026-05-15$51.69−0.9%31
2026-06-01$52.002026-06-09$51.87−0.3%8
2026-06-12$52.112026-07-14$51.87−0.5%32
2026-08-27$51.972026-09-01$51.62−0.7%5

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 trades that decided the result

Three trades produced most of the profit. The 2023-11-08 entry at an adjusted price of 42.63 closed on 2024-02-15 at 45.27 for 6.19% over 99 days. The 2024-05-08 entry at 45.37 closed on 2024-10-11 at 48.09 for 6.00% over 156 days. The 2025-04-29 entry at 48.77 closed on 2025-11-17 at 51.39 for 5.37% over 202 days, the longest hold of the window. Two smaller wins were the 3.37% trade from 2022-11-14 and the 2.37% trade from 2021-04-19.

Most of the remaining trades were close to flat or small losses. The median trade returned -0.43% and the median hold was 36 days. The worst loss was 1.91% on the 2024-12-03 entry, closed 16 days later on 2024-12-19. The shortest hold was 1 day, the 2021-11-10 trade. The rule has no stop and no profit target, and exits come only from the crossover. A worst loss of 1.91% is small for that design, which fits a fund that moves slowly.

The average win of 3.43% against an average loss of -0.75% is the core of the result. At a win rate of 35% the rule depends on the size of its wins, and the long trends supplied that. The longest win streak was 3 and the longest loss streak was 5. The 5-loss run is the 2026 run, when five consecutive round trips lost money.

The last trade entered on 2026-08-27 at 51.97 and closed on 2026-09-01 at 51.62 for -0.67%, so the rule finished the window in cash. The 20 round trips come from 40 fills. With 20 trades in 5.74 years, each decision would also cost a spread in live trading.

Largest drawdowns

PeakLow pointDepthDays to lowRecoveredDays to recover
2023-02-022023-11-09−5.3%2802023-12-1334
2024-10-012025-05-21−5.0%2322025-09-04106
2026-02-272026-09-01−3.9%186not yet–

Buy-and-hold's deepest drawdown ran from 2021-08-03 to 2022-10-20 and reached −20.1%.

Three drawdowns for the rule and two for the fund

The rule's deepest drawdown was 5.33%, from a 2023-02-02 peak to a 2023-11-09 trough, with recovery on 2023-12-13. The trough came 280 days after the peak, and recovery took 34 more days. That is a long, shallow slide: the equity curve drifted down while the rule took a string of small losses in the spring and summer of 2023.

The second drawdown was 4.99%, from 2024-10-01 to 2025-05-21, and it recovered on 2025-09-04. The peak sits at the end of the long 2024 trade, which closed on 2024-10-11, and the trough comes after the April 2025 exit. The third was 3.94%, from 2026-02-27 to a trough on 2026-09-01. It had not recovered by the end of the window, because the five 2026 losses had not been reversed.

Buy-and-hold had a much deeper and longer drawdown. It fell 20.13% from 2021-08-03 to 2022-10-20 and did not recover until 2025-06-26, which is 980 days from the trough. The fund itself, measured as a price series, fell 20.62% over the same dates and spent 977 sessions underwater. The rule's equity curve avoided most of that. It was in cash for the worst of 2022 and its biggest loss came in 2023.

Drawdown depth is the strongest case for the rule on this fund. Buy-and-hold lost 14.8 points more at its worst. The rule's three drawdowns were all under 6%, and all three came from whipsaw losses, not from holding through a decline. A rule with no stop can still avoid long declines when the crossover turns early enough, and on IGIB in 2022 it did.

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)2.4%−5.3%$11,4240.58
5 basis points2.0%−5.7%$11,2040.50
10 basis points1.6%−6.1%$10,9870.42

What 5 and 10 basis points did

The headline run charges nothing. With 5 basis points per fill the CAGR fell from 2.35% to 2.00% and the ending equity from $11,423.61 to $11,204.14. Maximum drawdown rose from 5.33% to 5.70% and the Sharpe fell from 0.59 to 0.501. With 10 basis points the CAGR was 1.65%, the ending equity $10,986.59, the drawdown 6.07% and the Sharpe 0.418.

The 20 round trips come from 40 fills, so every added basis point is charged 40 times. On a fund where the average winning trade is 3.43% and the average loser is -0.75%, the costs are small per trade, and they still reduce a 2.35% annual return by a visible share. At 10 basis points the run still ended above $10,000 and above the buy-and-hold ending equity of $10,121.16, but the margin shrank.

Costs matter more for this rule than for slower rules on the same fund. The golden cross trades much less and loses less to friction. The EMA rule pays a cost on each of the short whipsaw trades as well as on the long ones. Real spreads on IGIB may differ from either assumption. The fund's average daily dollar volume was $90,382,863 and its median minute volume was 1,684 shares.

Changing the parameters

VersionCAGRMax drawdownRound tripsWin rateFinal value
Published rules2.4%−5.3%2035%$11,424
EMA 8/211.7%−5.9%2733%$10,992
EMA 20/501.2%−6.4%1354%$10,688
EMA 12/501.6%−7.0%1644%$10,932

Faster and slower EMA pairs

The default pair is 12 and 26. Three variants were run on the same fund. A faster 8/21 pair returned 1.66% a year with a 5.93% drawdown and 27 trades, of which 9 won. A slower 20/50 pair returned 1.17% with a 6.42% drawdown and 13 trades, 7 of them wins. A 12/50 pair returned 1.56% with a 6.96% drawdown and 16 trades, 7 of them wins.

All three trailed the 12/26 default, which returned 2.35% with a 5.33% drawdown. They also had deeper drawdowns. The gap is small on the return side and the pattern is consistent, as neither the faster nor the slower pair beat the default on this fund. That is more reassuring than a sharp peak at one setting. It also means the default sits at a good setting for this window, which is partly luck. A result that was best at 12/26 and falling at both neighbours would be a thin basis for any claim about the setting.

The faster pair traded more, 27 times against 20, and it gave back more to cost. The slower pairs traded less and reacted late. All three variants still returned more than the 0.21% of buy-and-hold, and all had drawdowns well below its 20.13%. The edge here comes from the idea of stepping aside when a bond fund's trend turns down. The exact pair changes the result by a fraction of a point.

How IGIB behaved

MeasureIGIB
Data in this test2021-01-04 to 2026-10-02 (1444 sessions)
Total return, buy and hold1.3%
Annualized volatility6.3%
Deepest drawdown−20.6% (2021-08-03 to 2022-10-20)
Up days50.0%
Average daily range0.37%
Average overnight gap0.21%
Correlation to SPY0.35
Correlation to QQQ0.34
Correlation to TLT0.84
Sessions above the 200-day average66.3%
Crossings of the 200-day average52
Falls of 10% or more from a 20-day high0

Why IGIB suited a trend switch

IGIB lost 13.97% in calendar 2022 and then gained 9.21% in 2023, 3.52% in 2024 and 9.56% in 2025. That sequence is the one a trend filter is built to handle, a long decline followed by a long recovery. The fund's correlation to TLT was 0.84 and to SPY 0.35, with a beta to TLT of 0.34. It moved with the bond market and not with stocks.

Rate-sensitive funds trend. Their declines in 2022 ran for months, and the 12/26 pair caught the turn on 2022-07-18 and again on 2022-11-14. The fund was above its 200-day average for 66.27% of sessions and crossed it 52 times, which shows how often the trend flipped on a fund this quiet. It closed up on 49.97% of days, and the average up day of 0.30% and down day of -0.31% were almost the same size.

The overnight and intraday split looks odd. The fund earned 17.9% in log terms overnight and lost 16.67% inside the session. The whole return came from the overnight gap and the trading day subtracted from it. A rule that buys at the open and sells at the open holds through both parts, so the split has no direct effect, and it is one more sign of how little the fund moved in the session. The average intraday range was 0.37%.

Mean reversion had little to work with. RSI(14) fell below 30 on 66 sessions, and the median five-day return afterwards was -0.24%, with a 20-day median of -1.91%. RSI(2) fell below 10 on 169 sessions with a five-day median of 0.12%. The RSI(2) snapback returned 1.33% on this fund, lower than the EMA rule, and the RSI mean reversion rule lost 0.48%. On IGIB, oversold readings were followed by further weakness more often than by a bounce in this window.

Among bond funds, SGOV returned 3.21% on the same rule with a 0.05% drawdown, AGG returned 1.07%, BND returned 1.02%, IEI returned 0.87%, IEF lost 0.39% and TLT lost 0.67%. Longer duration funds did worse, and IGIB's credit exposure sat between the cash-like fund and the Treasury funds.

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.

How the crossover rules interact with a quiet fund

The rule buys at the open when EMA(12) is above EMA(26) and sells the whole position at the open when it is below, using 98% of the sleeve on entry. Because the crossover is checked on daily closes and acted on at the next open, there is a one-day delay on every signal. On a fund that moves 0.3% on an average day the delay costs little, and a one-day lag on a volatile fund costs more.

A faster exponential pair reacts sooner than a simple pair of the same length, and the cost is visible in the trade list. Entries in July 2023, December 2024 and mid-2026 were reversed within weeks. The losing trades in total did not erase the three long trends. On a quiet fund the losses are capped by how little the price moves in the days between the entry and the reversal.

The same rules on the other quiet funds give a comparison. The golden cross waits longer, returned 1.84% and made fewer trades. The 200-day regime filter returned 1.36%, with a 5.44% drawdown, and the 3-month momentum rule returned 0.25%. The trend plus trailing stop returned 0.06% with a 17.82% drawdown, because a 15% trailing stop is wide for a fund whose worst drawdown was 20.13%. The dip buyer and momentum breakout show a CAGR of 0% and no drawdown on this fund.

The limits of the test are plain. It is one window, the fund is a single bond fund with one major decline, the headline run has no costs, and the three long trades supplied most of the profit. A different window with fewer sustained trends would give a different answer. The EMA 12/26 strategy page shows the same rule on all 59 funds, and the IGIB page shows how every strategy fared on this fund.

Run EMA 12/26 trend on IGIB 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 IGIB?

Over 2021-01-04 to 2026-10-02, EMA 12/26 trend on IGIB returned 2.4% annualized vs 0.2% for buy-and-hold: it beat buy-and-hold by 2.1% per year, with a maximum drawdown 14.8 points shallower than holding (5.3% vs 20.1%).

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.

How did the EMA 12/26 trend rule do on IGIB?

It returned 2.35% a year from 2021-01-04 to 2026-10-02 and turned $10,000 into $11,423.61, with a maximum drawdown of 5.33% and a Sharpe of 0.59. Buy-and-hold on IGIB returned 0.21% a year with a 20.13% drawdown. The test has no fees or slippage in the headline run.

How often did the rule trade IGIB?

It made 20 round trips from 40 fills, and 7 of them won. The median hold was 36 days and the longest was 202 days. The rule was invested 56.1% of the time.

Why does a 35% win rate still make money?

The average win was 3.43% and the average loss was -0.75%, a profit factor of 2.36. Three long trades of 6.19%, 6.00% and 5.37% outweighed a run of small losses. The worst single loss was 1.91%.

What happened in 2022?

IGIB fell 13.97% as a fund and buy-and-hold lost 13.6%. The rule returned 1.5%, because it was in cash from 2022-01-05 to 2022-07-18 and again for most of the autumn. It re-entered on 2022-11-14 at an adjusted price of 41.26.

Do trading costs change the result?

Yes. At 5 basis points the CAGR was 2.00% and at 10 basis points it was 1.65%, with ending equity of $11,204.14 and $10,986.59. The rule still ended above buy-and-hold's $10,121.16 in both runs.

Is the 12/26 setting special?

Three variants, 8/21, 20/50 and 12/50, returned 1.66%, 1.17% and 1.56%. All trailed the 2.35% default and all beat buy-and-hold's 0.21%, so the result does not depend on one exact pair.

How did other strategies do on IGIB?

The golden cross returned 1.84%, the SMA 10/50 trend 1.73%, the 200-day regime filter 1.36% and RSI(2) snapback 1.33%. RSI mean reversion lost 0.48% and the monthly cycle lost 0.27%. See the [IGIB page](/learn/etf/igib/) for the full ranking.

Related

EMA 12/26 Trend on all 59 ETFsfull results table All strategies on IGIB12 templates compared RSI(14) Mean Reversion on IGIBsame ETF, different rulesRSI(2) Dip Snapback on IGIBsame 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.