200-Day SMA Regime Filter on AGG
iShares Core U.S. Aggregate Bond ETF: the broad US investment-grade bond market in one fund. Backtest 2021-01-04 to 2026-10-02, $10,000 starting capital, computed by the same engine that runs live DeployQuant strategies.
This test holds AGG, the iShares Core U.S. Aggregate Bond ETF, only on days that follow a close above its 200-day average, and moves to cash after a close below it. Over 5.74 years it made 25 round trips and turned $10,000 into $10,178. That is a CAGR of 0.31% and a total return of 1.78%. Holding AGG throughout ended at $9,559, with a CAGR of -0.78% and a total return of -4.41%. The rule finished ahead by about a point a year and its maximum drawdown was 6.23%, against 17.57% for buy-and-hold.
The lead comes from one year. AGG lost 12.7% in 2022 when simply held, and the rule lost 0.4% that year. In 2023 the rule lost 1% while buy-and-hold made 5.5%. It also trailed in 2024 and 2025. The rule beat buy-and-hold in 2021, 2022 and 2026 and fell behind in the other three years.
Among the 12 strategies run on AGG the rule is 5th. The RSI(2) snapback leads at 1.57%, then come the EMA 12/26 trend at 1.07%, the SMA 10/50 trend at 0.79% and the golden cross at 0.78%. The median CAGR of this filter over all 59 funds is 1.84%, and over the bond funds 0.37%, which puts AGG at 0.31% just under the bond median. AGG is 36th of 59 for this strategy. The strategy page shows every fund.
The test covers a single window, 2021-01-04 to 2026-10-02. Decisions are daily, there is no margin, and the headline run charges no fees.
Year by year
| Year | 200-day regime filter | buy & hold |
|---|---|---|
| 2021 | −0.9% | −1.6% |
| 2022 | −0.4% | −12.7% |
| 2023 | −1.0% | 5.5% |
| 2024 | 0.9% | 1.3% |
| 2025 | 4.3% | 7.0% |
| 2026 | −1.0% | −2.7% |
Year by year
The rule lost 0.9% in 2021, 0.4% in 2022 and 1% in 2023, made 0.9% in 2024 and 4.3% in 2025, and lost 1% in the partial year 2026. Buy-and-hold made -1.6%, -12.7%, 5.5%, 1.3%, 7% and -2.7%.
2021 was almost entirely cash. The rule held no position until 2021-10-28, when it bought at $97.27. That trade sold on 2021-11-16 at $96.73 for -0.56%. The rule then bought and sold three more times before the year ended, with returns of -0.38%, 0.09% and -0.43%. Its monthly returns in the last three months of 2021 were -0.1%, -0.29% and -0.49%. It lost 0.9% in the year against 1.6% for buy-and-hold.
The largest gap in the rule's favour was 2022. The last 2021 trade, bought on 2021-12-31 at $97.16, sold on 2022-01-03 at $96.74, and January 2022 lost 0.36%. From then on it sat in cash until December. Held throughout, AGG lost 12.7%; its plain calendar return was -13.02%. The rule's 12.3-point lead in 2022 is the largest gap in either direction. The rule avoided the slide by sitting in cash while the fund dropped to its low on 2022-10-20.
2023 was the rule's worst relative year. It made six round trips, and one of them won. The sequence was a 1-day gain of 0.23% from 2023-01-10, a 32-day loss of 1.17%, a 1-day loss of 0.38%, a 115-day loss of 1.28% from 2023-03-14 to 2023-07-07, a 21-day loss of 0.87% and a 1-day loss of 0.98%. On a calendar basis the fund rose 5.62%, and its best month in the held run was November at 4.48%. The rule was flat in September and October, then lost 0.17% in November and made 3.56% in December. Buy-and-hold made 5.5% for the year. The rule lost 1%, a 6.5-point gap against it.
2024 gave 0.9% against 1.3%. The 245-day trade from 2024-04-29 at $86.64 to 2024-12-30 at $90.49 returned 4.44%, and the trades around it lost small amounts. 2025 gave 4.3% against 7%. The 356-day trade from 2025-05-27 at $92.15 to 2026-05-18 at $96.46 returned 4.68%, the best of the test, though it spans two calendar years. In 2026 the rule lost 1% and buy-and-hold lost 2.7%, with seven round trips and two winners.
Month by month
| Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2021 | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | −0.1% | −0.3% | −0.5% |
| 2022 | −0.4% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% |
| 2023 | 0.7% | −1.9% | 0.9% | 0.6% | −1.1% | −0.3% | −1.1% | −1.9% | 0.0% | 0.0% | −0.2% | 3.6% |
| 2024 | −0.1% | −1.4% | 0.9% | −2.7% | 1.6% | 0.9% | 2.3% | 1.4% | 1.3% | −2.5% | 1.1% | −1.8% |
| 2025 | 0.0% | 1.6% | 0.0% | 0.2% | −1.9% | 1.4% | −0.3% | 1.2% | 1.1% | 0.6% | 0.6% | −0.3% |
| 2026 | 0.2% | 1.6% | −1.7% | 0.2% | −0.4% | 0.2% | −1.0% | −0.1% | 0.0% | 0.0% | – | – |
Monthly returns
Several stretches of the monthly table are empty because the rule was in cash. It held nothing from January to September 2021, from February to December 2022, and in September and October 2023. The rule's best month was December 2023 at 3.56%, and its worst was April 2024 at -2.68%. The held position's best month was November 2023 at 4.48%, and its worst was September 2022 at -4.07%, a month the rule sat out.
The rule's larger gains were 3.56% in December 2023, 2.32% in July 2024 and 1.65% in May 2024. In 2025 it made 1.6% in February and 1.44% in June, and in 2026 1.56% in February. Its larger losses were -1.94% in February 2023, -1.09% in May 2023, -1.13% in July and -1.9% in August 2023, -1.45% in February 2024 and -2.68% in April 2024, -2.47% in October 2024, -1.93% in May 2025, and -1.73% in March 2026.
Averaged across calendar years, the fund did best in November at 2.08% and worst in September at -1.31%, with October at -0.95% and April at -0.74% next. Each of those averages has only 5 or 6 years behind it. The rule's April 2024 loss of 2.68% falls in the fund's weak April.
Every trade
200-day regime filter on AGG made 25 closed round trips, an average hold of 46 days, an average winner of 1.33%, an average loser of −0.51%, a profit factor of 1.22, a longest losing streak of 5. It held a position at the close on 54.8% of trading days.
| Entry | Entry price | Exit | Exit price | Return | Days held |
|---|---|---|---|---|---|
| 2021-10-28 | $97.27 | 2021-11-16 | $96.73 | −0.6% | 19 |
| 2021-11-22 | $96.91 | 2021-11-23 | $96.54 | −0.4% | 1 |
| 2021-11-29 | $96.92 | 2021-12-30 | $97.01 | 0.1% | 31 |
| 2021-12-31 | $97.16 | 2022-01-03 | $96.74 | −0.4% | 3 |
| 2023-01-10 | $86.25 | 2023-01-11 | $86.45 | 0.2% | 1 |
| 2023-01-12 | $86.98 | 2023-02-13 | $85.96 | −1.2% | 32 |
| 2023-02-14 | $86.03 | 2023-02-15 | $85.70 | −0.4% | 1 |
| 2023-03-14 | $86.42 | 2023-07-07 | $85.31 | −1.3% | 115 |
| 2023-07-12 | $86.24 | 2023-08-02 | $85.49 | −0.9% | 21 |
| 2023-08-10 | $86.02 | 2023-08-11 | $85.18 | −1.0% | 1 |
| 2023-11-29 | $86.22 | 2024-04-17 | $86.55 | 0.4% | 140 |
| 2024-04-18 | $86.65 | 2024-04-26 | $86.49 | −0.2% | 8 |
| 2024-04-29 | $86.64 | 2024-12-30 | $90.49 | 4.4% | 245 |
| 2024-12-31 | $90.63 | 2025-01-07 | $90.13 | −0.6% | 7 |
| 2025-01-17 | $90.56 | 2025-02-13 | $90.96 | 0.4% | 27 |
| 2025-02-14 | $91.49 | 2025-04-14 | $91.80 | 0.3% | 59 |
| 2025-04-15 | $92.00 | 2025-05-15 | $91.94 | −0.1% | 30 |
| 2025-05-16 | $92.52 | 2025-05-22 | $91.45 | −1.2% | 6 |
| 2025-05-27 | $92.15 | 2026-05-18 | $96.46 | 4.7% | 356 |
| 2026-05-26 | $97.11 | 2026-06-08 | $97.06 | −0.1% | 13 |
| 2026-06-10 | $97.05 | 2026-07-09 | $97.08 | 0.0% | 29 |
| 2026-07-10 | $97.20 | 2026-07-13 | $96.92 | −0.3% | 3 |
| 2026-07-16 | $97.02 | 2026-07-21 | $96.83 | −0.2% | 5 |
| 2026-08-20 | $96.80 | 2026-08-21 | $96.78 | −0.0% | 1 |
| 2026-08-26 | $97.18 | 2026-08-28 | $97.12 | −0.1% | 2 |
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 25 trades
The rule closed 25 round trips with an average hold of 46.2 days and a median of 13. The longest was 356 days and the shortest 1. Winners numbered 8, a 32% win rate. The average winner made 1.33% and the average loser lost 0.51%, giving a profit factor of 1.22. The median trade returned -0.18%. Two wins in a row was the best run, and five losses in a row the worst. The rule was invested at the close on 54.8% of days.
The two longest holds paid for most of the rest. The 356-day trade returned 4.68% and the 245-day trade 4.44%. The other three of the five best were 0.44%, 0.38% and 0.34%. The five worst were -1.28%, -1.17%, -1.16%, -0.98% and -0.87%. The worst trade was the 115-day hold from 2023-03-14 at $86.42 to 2023-07-07 at $85.31. The shortest losing trades, held for a day, include a 0.98% loss from 2023-08-10 to 2023-08-11.
The trade count by year was 3 in 2021, 1 in 2022, 6 in 2023, 3 in 2024, 5 in 2025 and 7 in 2026. The wins by year were 1, 0, 1, 2, 2 and 2. Most of the trades are short: the median hold of 13 days sits far below the 46.2-day average, which shows a rule where a few long holds pull up the mean. The rule's known weakness is churn when price wobbles around the 200-day line near a bottom, and the 2023 run of short trades shows it.
The prices quoted in this section are adjusted for splits and dividends, which is why they sit below the figures printed at the time.
Clusters of one-day and two-day trades
Several of the 25 trades lasted three days or fewer, and they sit in clusters. In November 2021 the rule bought on 2021-11-22 at $96.91 and sold on 2021-11-23 at $96.54 for -0.38%. In 2023 there were three one-day trades: 2023-01-10 for 0.23%, 2023-02-14 for -0.38% and 2023-08-10 for -0.98%. In 2026 the 2026-08-20 entry at $96.80 sold the next day at $96.78 for -0.02%, and the 2026-08-26 entry at $97.18 sold on 2026-08-28 at $97.12 for -0.06%. A cluster means the closing price was oscillating around its 200-day average, and the rule paid the open-to-open gap each time.
The 2024 sequence shows how a single crossing becomes three trades. The 140-day trade from 2023-11-29 sold on 2024-04-17 at $86.55 for 0.38%. The rule bought again on 2024-04-18 at $86.65 and sold on 2024-04-26 at $86.49 for -0.18%, then bought on 2024-04-29 at $86.64, which became the 245-day winner of 4.44%. April 2024 is also the rule's worst month at -2.68%, and every trade in that month was small.
The 2025 sequence repeats the pattern. The rule bought on 2025-02-14 at $91.49 and sold on 2025-04-14 at $91.80 for 0.34%. It bought on 2025-04-15 at $92.00 and sold on 2025-05-15 at $91.94, then bought on 2025-05-16 at $92.52 and sold on 2025-05-22 at $91.45 for -1.16%. The next entry, on 2025-05-27 at $92.15, was the 356-day trade. Its exit on 2026-05-18 at $96.46 was followed by six more trades in 2026, each within about 30 cents of break-even.
Largest drawdowns
| Peak | Low point | Depth | Days to low | Recovered | Days to recover |
|---|---|---|---|---|---|
| 2021-11-09 | 2023-11-30 | −6.2% | 751 | 2024-08-20 | 264 |
| 2024-09-16 | 2025-05-22 | −4.5% | 248 | 2025-10-13 | 144 |
| 2026-02-27 | 2026-08-28 | −2.8% | 182 | not yet | – |
Buy-and-hold's deepest drawdown ran from 2021-01-04 to 2022-10-20 and reached −17.6%.
Drawdowns
The rule's worst drawdown was 6.23%, measured from a peak on 2021-11-09 to a low on 2023-11-30, 751 days later. It recovered on 2024-08-20, 264 days after the low. The second was 4.55%, from 2024-09-16 to 2025-05-22, recovered on 2025-10-13 after 144 days. The third began on 2026-02-27, reached 2.77% by 2026-08-28 and had not recovered by the end of the data.
The longest drawdown, the first, covers most of 2022 and 2023. The rule was in cash for 2022 and lost money in the 2023 whipsaws, so the equity curve stayed below its 2021 high for two years. The drawdown was shallow but long because the rule neither made nor lost much in that stretch.
Buy-and-hold's deepest drawdown was 17.57%, from 2021-01-04 to 2022-10-20. It took 654 days to reach the low and was still under water when the data ended. The fund's raw price series shows -17.98% over those dates and a longest drawdown of 1,443 sessions, nearly the whole window. That is the key fact for a bond fund holder in this period: a position held from the first day was under water from the first day to the last. The rule's drawdown is much shallower, because it left the fund once price fell under its trend.
With trading costs
The headline run fills at the bar price. These runs charge slippage on every fill.
| Slippage per fill | CAGR | Max drawdown | Final value | Sharpe |
|---|---|---|---|---|
| None (headline) | 0.3% | −6.2% | $10,178 | 0.10 |
| 5 basis points | −0.1% | −7.3% | $9,930 | -0.01 |
| 10 basis points | −0.6% | −8.3% | $9,689 | -0.13 |
Costs
Over 25 round trips the rule has 50 fills. Charging 5 basis points of slippage on each moves the CAGR to -0.12%, the drawdown rises to 7.25% and the final value is $9,930, with a Sharpe ratio of -0.01. At 10 basis points the CAGR is -0.55%, the drawdown 8.35% and the final value $9,689, with a Sharpe ratio of -0.13. The headline figures are 0.31%, 6.23%, $10,178 and 0.1.
The cost runs remove the rule's profit but leave it ahead of buy-and-hold. At 5 basis points the rule's final value is $9,930, above buy-and-hold's $9,559. At 10 basis points it is $9,689, still above. The rule remains ahead on drawdown in both runs. A CAGR near zero means that any friction moves the sign of the return, so the profit in the headline run is smaller than the size of the assumption.
Changing the parameters
| Version | CAGR | Max drawdown | Round trips | Win rate | Final value |
|---|---|---|---|---|---|
| Published rules | 0.3% | −6.2% | 25 | 32% | $10,178 |
| 100-day SMA | 0.3% | −6.7% | 43 | 30% | $10,197 |
| 150-day SMA | −0.4% | −8.3% | 35 | 20% | $9,778 |
| 250-day SMA | 0.2% | −7.4% | 18 | 28% | $10,129 |
Changing the parameters
Three other averages were tested. The 100-day average made 43 trades with 13 winners, a CAGR of 0.34%, a drawdown of 6.69% and a final value of $10,197. The 150-day average made 35 trades with 7 winners, a CAGR of -0.39%, a drawdown of 8.27% and a final value of $9,778. The 250-day average made 18 trades with 5 winners, a CAGR of 0.22%, a drawdown of 7.39% and a final value of $10,129. The published 200-day rule returned 0.31% with a drawdown of 6.23%.
The four results sit within a narrow band. Three of the four are positive and one is slightly negative, and the 150-day average is the odd one. The 200-day setting has the shallowest drawdown of the four, and the 100-day setting has the highest CAGR and the most trades. The faster 100-day average made more trades, 43 with 13 winners.
All four variants beat buy-and-hold's -0.78% CAGR. Every variant had a much smaller drawdown than 17.57%. The conclusion is that the filter's benefit on AGG, the shallower drawdown, does not depend on the choice of window, while the return is close to zero at every setting.
How AGG behaved
| Measure | AGG |
|---|---|
| Data in this test | 2021-01-04 to 2026-10-02 (1444 sessions) |
| Total return, buy and hold | −4.5% |
| Annualized volatility | 5.8% |
| Deepest drawdown | −18.0% (2021-01-04 to 2022-10-20) |
| Up days | 49.3% |
| Average daily range | 0.35% |
| Average overnight gap | 0.21% |
| Correlation to SPY | 0.22 |
| Correlation to QQQ | 0.21 |
| Correlation to TLT | 0.92 |
| Sessions above the 200-day average | 63.6% |
| Crossings of the 200-day average | 50 |
| Falls of 10% or more from a 20-day high | 0 |
How AGG behaved
Over the window AGG returned -4.53%, a CAGR of -0.8%, and an annualized volatility of 5.82%. It closed up on 49.27% of sessions. Up days averaged 0.28% and down days -0.28%, the typical daily range was 0.35% and the typical overnight gap 0.21%. Its best day was 2.14% on 2022-11-10 and its worst was -1.63% on 2022-06-13. By calendar year it returned -1.64% in 2021, -13.02% in 2022, 5.62% in 2023, 1.35% in 2024, 7.19% in 2025, and -2.75% in 2026 to date.
The fund tracks the bond market. Against SPY its correlation was 0.22 and against QQQ 0.21, while its correlation to TLT was 0.92. It was most correlated with BND at 1 and IEF at 0.97, and least correlated with TBF at -0.91. Split by session, the overnight part of its log return was 6.82% and the intraday part -11.45%: gains came overnight, losses during the day. No 20-day high was ever followed by a fall of 10% or more.
For a trend rule the key figure is the 200-day line. Price finished above the 200-day average on 63.61% of sessions and crossed the line 50 times in 5.74 years. That many crossings for such a quiet fund accounts for the bunches of short trades. RSI(14) dropped under 30 on 59 sessions, and the median 5-day forward return after those was -0.04% and the 20-day return -0.9%, against baselines of -0.01% and 0.07%. Oversold readings did not bounce here. RSI(2) closed under 10 on 167 sessions, with median forward returns of 0.05% over 5 days and 0.12% over 20, near the baseline.
Median minute volume was 8,686 shares and average daily dollar volume was 647,965,164. By calendar month, November averaged 2.08% and September -1.31%. Day-of-week averages were within 0.07% of zero.
Weekdays, price range and what the peers did
AGG moved little on any weekday. The average return was -0.07% on Monday, 0.02% on Tuesday, 0.05% on Wednesday, -0.01% on Thursday and -0.01% on Friday. The fund's worst days, -1.63% on 2022-06-13 and -1.3% on 2022-09-26, were both inside the 2022 stretch when the rule was in cash, and its best day, 2.14% on 2022-11-10, was also missed.
The trade prices tell the same story as the volatility figure. The rule's entries ran from about $86 in 2023 to about $97 in 2026, and a typical entry-to-exit move was a few tenths of a dollar. With an average daily range of 0.35%, a single session can erase a whole trade, which is why the median trade returned -0.18%.
Among bond funds the same filter made 21 round trips on BND and 25 on AGG, though the two funds have a correlation of 1 in the data. BND returned 0.37% and AGG 0.31%, a small gap that comes from the exact dates on which each fund's close crossed its own average. IGIB, made 26 round trips and returned 1.36%. A near-perfect correlation does not give identical trade lists when the rule fires on a threshold, and that is a limit of any single-fund result on this page.
The rules
Own the asset when price closes above its 200-day average; hold cash when it closes below.
- WHEN the market opens · IF not invested AND yesterday's close > SMA(200) · THEN buy with 98% of the sleeve
- WHEN the market opens · IF invested AND yesterday's close < SMA(200) · THEN sell the whole position
One rule and one number. Price above the 200-day moving average has historically coincided with better returns and lower volatility than price below it. This template uses no crossovers and no oscillators, only which side of the long-term average the price is on.
Good for: a first systematic strategy, simple enough to audit every trade.
Watch out: price whips around the 200-day line during volatile bottoms, generating clusters of buy-sell pairs. Some traders add a small buffer band to reduce churn.
Why a 200-day line churns on a bond fund
Orders go in at the open, based on the prior close against the 200-day average. There is no buffer around the line. On a fund with 5.82% volatility the price sits close to its 200-day average for long stretches, so small moves push it across, and the rule trades. The strategy notes mention that some traders add a buffer band to cut the churn. No band is used in this test.
The same rule on other bond funds shows the spread. SGOV returned 3.22% over 5 round trips with a drawdown of 0.02%, IGIB 1.36% with 26 trips, IEI 1.03% with 21, and BND 0.37% with 21. AGG returned 0.31% with 25. IEF lost 1.53% with a drawdown of 11.5%, and TLT lost 7.58% with a drawdown of 40.21% and 48 round trips. IEF and TLT both lost money, and TLT traded far more than AGG.
On AGG itself, other trend rules did better. The EMA 12/26 returned 1.07% with a drawdown of 4.88%, the SMA 10/50 0.79% with 6.46%, and the golden cross 0.78% with 7.13%. The trend plus trailing stop was last at -1.1% with a drawdown of 18.83%, and the monthly cycle lost 0.91%. The 3-month momentum lost 0.74% with the shallowest drawdown among the losers, 5.72%. All 12 strategies on AGG are ranked on its fund page.
The 200-day filter protected the account in 2022 and gave back part of that in the whipsaws of 2023. One window, one fund, 25 trades.
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 200-day regime filter beat buy-and-hold on AGG?
Over 2021-01-04 to 2026-10-02, 200-day regime filter on AGG returned 0.3% annualized vs −0.8% for buy-and-hold: it beat buy-and-hold by 1.1% per year, with a maximum drawdown 11.3 points shallower than holding (6.2% vs 17.6%).
How many trades did it make?
25 completed round trips over 5.7 years (50 fills), with 32% of round trips closing profitably.
Why the 200-day average specifically?
It approximates a year of trading days and has been studied across decades of data. It is not the best window for every asset. The per-ETF backtests here show where it helped and where it didn't.
Did the 200-day filter beat holding AGG?
Yes. The rule ended at $10,178 for 0.31% a year, where holding ended at $9,559 for -0.78%. Its maximum drawdown was 6.23% against 17.57%. Most of the lead came from 2022, when the rule lost 0.4% and buy-and-hold lost 12.7%.
How many trades did this rule make?
There were 25 round trips, which is 50 fills. Winners were 8, or 32%. The average hold was 46.2 days and the longest 356 days.
What happened in 2023?
The rule made six round trips and won one, and the year ended at -1% against 5.5% for buy-and-hold. Price crossed the 200-day line several times in the first half of the year. Its worst trade, -1.28%, came from 2023-03-14 to 2023-07-07.
Do trading costs matter on AGG?
Yes. With 5 basis points charged the CAGR was -0.12% and at 10 basis points -0.55%. The final values were $9,930 and $9,689, still above buy-and-hold's $9,559.
Does a different moving average length work better?
In this window the 100-day average returned 0.34% and the 250-day 0.22%, against 0.31% for 200 days. The 150-day returned -0.39%. All four had much shallower drawdowns than buy-and-hold.
What is the best strategy on AGG in this test?
The RSI(2) snapback returned 1.57%, followed by the EMA 12/26 at 1.07%. The 200-day filter ranked 5th of 12 at 0.31%.
Related
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.