200-Day SMA Regime Filter 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.
The 200-day regime filter buys a fund once its close is above the 200-day simple average and moves to cash when the close falls under it. On IEI, the iShares 3-7 Year Treasury Bond ETF, it turned $10,000 into $10,608 between 2021-01-04 and 2026-10-02. That is a total return of 6.08% and a CAGR of 1.03%.
Holding IEI lost money over the same dates. Buy-and-hold turned $10,000 into $9,793, a CAGR of -0.36% and a maximum drawdown of 13.8%. The filter beat holding by 1.39 CAGR points and had a maximum drawdown of 4.62%. It beat holding in 2021, 2022 and 2026.
The rule made 21 round trips and won 7, a win rate of 33%. The average win was 1.55% and the average loss was -0.32%, and the profit factor was 2.37. It was invested 51% of the time. A low win rate with a positive profit factor is what a trend filter looks like: many small losses and a few long gains. On IEI the few long gains were three trades that lasted 141, 256 and 484 days.
Year by year
| Year | 200-day regime filter | buy & hold |
|---|---|---|
| 2021 | 0.0% | −2.5% |
| 2022 | 0.0% | −9.3% |
| 2023 | −0.1% | 4.3% |
| 2024 | 1.5% | 1.9% |
| 2025 | 6.1% | 6.6% |
| 2026 | −1.3% | −2.4% |
Year by year against holding IEI
The filter returned 0% in 2021, 0% in 2022, -0.1% in 2023, 1.5% in 2024, 6.1% in 2025 and -1.3% in the partial 2026 year. Holding returned -2.5%, -9.3%, 4.3%, 1.9%, 6.6% and -2.4%.
The two zero years are the filter's main result. IEI lost 2.5% in 2021 and 9.3% in 2022 when held, and the filter stayed in cash both years. It made no trade until 2023-01-12. The 2022 gap to holding was 9.3 points, the largest of the six years. This is the use case for a regime filter: a bond fund that fell for most of two years and spent that time below its 200-day average.
In 2023 the filter trailed holding by 4.4 points, at -0.1% against 4.3%. It was re-entering and exiting in a choppy stretch, and nine round trips closed that year with 2 wins. In 2024 it trailed by 0.4 points and in 2025 by 0.5. In 2025 it sold one long position on 2025-01-13, bought another on 2025-01-16 and held it into 2026, and the year returned 6.1% against 6.6%.
In 2026 it beat holding by 1.1 points at -1.3% against -2.4%. The 484-day position was sold on 2026-05-15, and a run of one-day to seven-day trades followed in June through August. The result across years is a rule that avoided the worst of a bad stretch for IEI, gave up a few points during the recovery, and traded more in 2023 and 2026 than in the quiet years.
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.0% | 0.0% | 0.0% |
| 2022 | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% | 0.0% |
| 2023 | 0.1% | −0.9% | 1.1% | 0.6% | −0.9% | −1.2% | −1.0% | −0.6% | 0.0% | 0.0% | 0.5% | 2.3% |
| 2024 | 0.3% | −1.3% | 0.4% | −1.9% | 1.1% | 0.9% | 2.1% | 1.1% | 1.0% | −2.1% | 0.6% | −0.7% |
| 2025 | −0.1% | 1.6% | 0.6% | 1.3% | −0.7% | 1.0% | −0.4% | 1.4% | 0.1% | 0.5% | 0.7% | −0.2% |
| 2026 | 0.0% | 1.4% | −1.5% | 0.0% | −0.6% | −0.1% | −0.4% | −0.2% | 0.0% | 0.0% | – | – |
The months that moved the account
The best month was December 2023 at +2.25%, followed by July 2024 at +2.12%, February 2025 at +1.62% and August 2025 at +1.42%. Holding's best month was March 2023 at +2.83%.
The worst month was October 2024 at -2.06%, followed by April 2024 at -1.89%, March 2026 at -1.47% and February 2024 at -1.31%. Holding's worst month was March 2022 at -3.04%, a month the filter sat out.
For a fund with an annualized volatility of 4.57%, a 2% month is large. The monthly figures show a fund that moves in brief bursts of a point or two against long flat stretches. The filter had no return in any month of 2021 or 2022. After that, monthly results were mixed. May to September 2024 was a run of positive months, and 2025 and 2026 alternated between gains and small losses.
The pattern in the table is a filter that captured the moves that lasted. The large positive months, December 2023 and July 2024, came while the long positions were open.
IEI's biggest days against the filter's cash periods
Four of IEI's five worst days fell while the filter held nothing. The list is 2022-06-13 at -1.09%, 2024-04-10 at -0.98%, 2022-08-05 at -0.97%, 2022-08-02 at -0.92% and 2022-03-02 at -0.91%. Four of those are in 2022, when the filter was in cash for every month, and the exception is 2024-04-10, which fell inside the long trade that began on 2023-11-28. That trade closed on 2024-04-17 with a gain of 0.57%, and April 2024 ended at -1.89% for the filter. The filter avoided four of the five worst days and sat through the fifth.
The best days sit in the same period. The fund's gains of 1.45% on 2022-11-10 and 1.37% on 2022-09-28 came while the filter was in cash, and the three biggest gains of March 2023, at 1.2% on 2023-03-13, 1.16% on 2023-03-10 and 1.12% on 2023-03-15, were partly missed. The entry came on 2023-03-14, so the 03-13 and 03-10 days were missed and only 03-15 was inside the position. March 2023 returned 1.05% for the filter, while holding made 2.83%, the best month in the holding record.
The weekday averages for IEI were -0.04% on Mondays, 0.01% on Tuesdays, 0.03% on Wednesdays and 0% on Thursdays and Fridays. RSI(2) closed below 10 on 183 sessions, and the median 5-day return afterward was -0.04% against -0.03% for any day, so there was no bounce edge to lean on.
Every trade
200-day regime filter on IEI made 21 closed round trips, an average hold of 51 days, an average winner of 1.55%, an average loser of −0.32%, a profit factor of 2.37, a longest losing streak of 4. It held a position at the close on 51.0% of trading days.
| Entry | Entry price | Exit | Exit price | Return | Days held |
|---|---|---|---|---|---|
| 2023-01-12 | $104.13 | 2023-02-07 | $103.24 | −0.8% | 26 |
| 2023-03-14 | $103.73 | 2023-07-05 | $103.06 | −0.7% | 113 |
| 2023-07-13 | $104.02 | 2023-07-28 | $103.19 | −0.8% | 15 |
| 2023-08-01 | $103.07 | 2023-08-02 | $102.97 | −0.1% | 1 |
| 2023-08-07 | $103.41 | 2023-08-08 | $103.64 | 0.2% | 1 |
| 2023-08-09 | $103.68 | 2023-08-11 | $102.88 | −0.8% | 2 |
| 2023-11-15 | $103.08 | 2023-11-16 | $103.34 | 0.3% | 1 |
| 2023-11-17 | $103.39 | 2023-11-20 | $103.27 | −0.1% | 3 |
| 2023-11-21 | $103.51 | 2023-11-27 | $103.38 | −0.1% | 6 |
| 2023-11-28 | $103.60 | 2024-04-17 | $104.19 | 0.6% | 141 |
| 2024-04-18 | $104.27 | 2024-04-26 | $104.12 | −0.1% | 8 |
| 2024-04-29 | $104.26 | 2024-05-01 | $104.22 | −0.0% | 2 |
| 2024-05-02 | $104.41 | 2025-01-13 | $107.67 | 3.1% | 256 |
| 2025-01-16 | $108.24 | 2026-05-15 | $115.24 | 6.5% | 484 |
| 2026-06-01 | $115.53 | 2026-06-02 | $115.79 | 0.2% | 1 |
| 2026-06-17 | $115.97 | 2026-06-18 | $115.74 | −0.2% | 1 |
| 2026-06-25 | $116.13 | 2026-07-02 | $115.95 | −0.1% | 7 |
| 2026-07-06 | $115.98 | 2026-07-08 | $115.55 | −0.4% | 2 |
| 2026-08-14 | $116.05 | 2026-08-17 | $115.81 | −0.2% | 3 |
| 2026-08-20 | $115.74 | 2026-08-21 | $115.76 | 0.0% | 1 |
| 2026-08-26 | $115.94 | 2026-08-27 | $115.94 | 0.0% | 1 |
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.
All twenty-one trades
The first trade bought on 2023-01-12 at an adjusted price of 104.13 and sold on 2023-02-07 at 103.24, a loss of 0.85% over 26 days. The second bought on 2023-03-14 at 103.73 and sold on 2023-07-05 at 103.06, a loss of 0.65% over 113 days. The third bought on 2023-07-13 at 104.02 and sold on 2023-07-28 at 103.19, a loss of 0.8% over 15 days.
August 2023 had three short trades: -0.1% over 1 day, +0.22% over 1 day and -0.77% over 2 days. November 2023 had four: +0.25%, -0.12%, -0.13% and then a longer one. The trade that bought on 2023-11-28 at 103.6 and sold on 2024-04-17 at 104.19 gained 0.57% over 141 days. Twelve of the 21 trades lasted 3 days or less.
The best trade bought on 2025-01-16 at 108.24 and sold on 2026-05-15 at 115.24, a gain of 6.47% over 484 days, the longest hold. The second best bought on 2024-05-02 at 104.41 and sold on 2025-01-13 at 107.67, +3.12% over 256 days. These two trades are the reason the CAGR is positive. They fall between the two long runs of short trades.
The worst trades were small. The worst bought on 2023-01-12 and lost 0.85%. Then came -0.8% from 2023-07-13 to 2023-07-28, -0.77% from 2023-08-09 to 2023-08-11, -0.65% in the 113-day hold and -0.37% from 2026-07-06 to 2026-07-08. The last trade bought on 2026-08-26 at 115.94 and sold the next day at 115.94, a return of 0%.
The median trade lost 0.12% and lasted 3 days. Three wins in a row was the best run, and four losses in a row the worst. The average win of 1.55% is far larger than the average loss of -0.32%, and that carries a 33% win rate to a profit factor of 2.37.
Largest drawdowns
| Peak | Low point | Depth | Days to low | Recovered | Days to recover |
|---|---|---|---|---|---|
| 2023-05-04 | 2023-11-24 | −4.6% | 204 | 2024-08-01 | 251 |
| 2024-09-16 | 2025-01-13 | −3.5% | 119 | 2025-04-03 | 80 |
| 2026-02-27 | 2026-08-17 | −2.8% | 171 | not yet | – |
Buy-and-hold's deepest drawdown ran from 2021-01-04 to 2022-10-20 and reached −13.8%.
Drawdowns
The maximum drawdown was 4.62%, from a peak on 2023-05-04 to a trough on 2023-11-24, 204 days, with recovery on 2024-08-01, 251 days after the trough. The second drawdown was 3.52%, from 2024-09-16 to 2025-01-13, which recovered on 2025-04-03. The third was 2.76%, from 2026-02-27 to 2026-08-17, not recovered by the end of the data.
Holding IEI had a 13.8% drawdown from 2021-01-04 to 2022-10-20 that took until 2025-10-16 to recover, 1,092 days after the peak. The filter's drawdown was 9.18 points shallower. That difference is the filter's whole benefit, and it comes from staying out during 2021 and 2022.
The filter's own drawdowns came from the choppy stretches, not from a decline in the fund. The 4.62% drawdown ran through the spring and summer of 2023, when the rule was entering and exiting at small losses. A drawdown of under 5% on a bond fund is a modest figure, and holding the fund through 2022 produced a 13.8% loss.
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) | 1.0% | −4.6% | $10,608 | 0.36 |
| 5 basis points | 0.7% | −5.3% | $10,395 | 0.24 |
| 10 basis points | 0.3% | −6.1% | $10,185 | 0.12 |
What costs did
The headline run has no fees or slippage, and on IEI that matters more than on most funds. At 5 basis points the CAGR fell from 1.03% to 0.68% and the maximum drawdown rose from 4.62% to 5.28%. At 10 basis points the CAGR was 0.32% and the drawdown was 6.11%. The ending equity was $10,608 with no costs, $10,395 at 5 basis points and $10,185 at 10.
The reason is the combination of 42 fills and a fund that moves 0.25% in an average day. The average hold was 51.2 days, but the median was 3 days, and the short trades earn or lose fractions of a percent. Ten basis points on each of 42 fills is a large share of what the strategy made. Trading in IEI averaged $172,230,207 a day, with a median of 1,292 shares per minute bar, so the 5 basis point run is a reasonable test and the 10 basis point run is conservative. At 10 basis points the filter still ended ahead of the $9,793 for holding.
Changing the parameters
| Version | CAGR | Max drawdown | Round trips | Win rate | Final value |
|---|---|---|---|---|---|
| Published rules | 1.0% | −4.6% | 21 | 33% | $10,608 |
| 100-day SMA | 0.3% | −5.8% | 37 | 27% | $10,183 |
| 150-day SMA | 0.6% | −3.3% | 28 | 25% | $10,367 |
| 250-day SMA | 0.9% | −4.7% | 24 | 38% | $10,558 |
Other averages on IEI
We reran the filter with three different average lengths.
- 100-day SMA: CAGR 0.32%, maximum drawdown 5.8%, 37 trades with 10 wins, ending equity $10,183.
- 150-day SMA: CAGR 0.63%, maximum drawdown 3.33%, 28 trades with 7 wins, ending equity $10,367.
- 250-day SMA: CAGR 0.95%, maximum drawdown 4.74%, 24 trades with 9 wins, ending equity $10,558.
The default 200-day average at 1.03% did best, and the 250-day average was close at 0.95%. A shorter average produced more trades and a lower CAGR: the 100-day version made 37 trades and returned 0.32%. The 150-day version had the shallowest drawdown at 3.33% and a CAGR of 0.63%.
The ordering follows the trade count. More trades meant lower returns, since a bond fund moves little and each extra trade adds cost and whipsaw. The differences are small, within a point of CAGR, and every variant beat the -0.36% of holding. We did not tune the length, and a result of 200 on this fund and this window is not a finding about 200 days.
How IEI behaved
| Measure | IEI |
|---|---|
| Data in this test | 2021-01-04 to 2026-10-02 (1444 sessions) |
| Total return, buy and hold | −2.3% |
| Annualized volatility | 4.6% |
| Deepest drawdown | −14.2% (2021-01-04 to 2022-10-20) |
| Up days | 48.2% |
| Average daily range | 0.25% |
| Average overnight gap | 0.16% |
| Correlation to SPY | 0.08 |
| Correlation to QQQ | 0.09 |
| Correlation to TLT | 0.80 |
| Sessions above the 200-day average | 59.2% |
| Crossings of the 200-day average | 42 |
| Falls of 10% or more from a 20-day high | 0 |
How IEI behaved
IEI holds US Treasuries with remaining maturities of 3 to 7 years, and the data describes it as shorter-duration Treasuries with milder swings. It returned -2.25% over the window, a CAGR of -0.39%, with an annualized volatility of 4.57%. Its maximum drawdown was 14.21%, from 2021-01-04 to 2022-10-20, and it recovered on 2025-10-16. The longest drawdown ran 1,201 sessions.
On the raw fund, 2022 was the worst calendar year at -9.54%, 2025 the best at 6.83%, and the partial 2026 year stood at -2.48%. IEI closed up on 48.23% of days, so down days were slightly more common than up days. Typical moves were small, with an average intraday range of 0.25% and an overnight gap of 0.16%. The largest gain in one day was 1.45% on 2022-11-10, and the largest fall was 1.09% on 2022-06-13.
It is nearly unrelated to stocks. Its beta to SPY was 0.02 and its correlation was 0.08, against 0.09 for QQQ. Against TLT the correlation was 0.8. The funds that moved most like it were IEF at 0.97, AGG and BND at 0.94, UST at 0.91 and IGIB at 0.89, and TBF moved against it at -0.8.
The price was above its 200-day average on 59.2% of sessions and crossed it 42 times. Each round trip uses two crosses of the line. The fund had no events of a 10% drop inside 20 sessions. RSI(14) fell below 30 on 64 sessions, and the median 20-day return after those was -0.65% against a baseline of 0.04%. Weakness in IEI did not mean a bounce.
The long decline in 2021 and 2022 and the slow recovery after it are the shape a trend filter handles well. A bond fund can lose over several quarters, and a rule that exits after the average turns avoids part of that.
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.
How the 200-day filter fits a bond fund
The other strategies on IEI show a narrow range. The trend plus trailing stop returned 1.43% and the RSI(2) snapback returned 1.42%. The SMA 10/50 trend returned 1.24% with the shallowest drawdown of the group at 3.21%, and the golden cross returned 1.09%. The 200-day filter at 1.03% ranked 5th of 12, ahead of the EMA 12/26 trend at 0.87%.
The dip buyer and the momentum breakout both returned 0% because IEI never produced the entry they wait for. RSI mean reversion lost 0.2%, the weekly 7% target lost 0.26%, the 3-month momentum rule lost 0.59% and the monthly cycle lost 0.84% with a 15% drawdown. Every moving-average rule made money, and most of the rules that act on a fixed schedule or a short signal lost it.
The same filter on other bond funds gave a wide spread. SGOV and IGIB came out ahead of IEI, at 3.22% and 1.36%. BND and AGG were behind it at 0.37% and 0.31%, IEF lost 1.53% and TLT lost 7.58%. IEI at 1.03% was 34th of 59 funds for this rule. Across all 59 funds the median was 1.84%, and the median for bond funds was 0.37%. The longer the duration, the worse the filter did, which tracks the choppier path of longer bonds.
Where the filter churned
The template's own caveat is that price whips around the 200-day line, generating clusters of buy-sell pairs. IEI shows it in three places. August 2023 had three round trips, November 2023 had four and the stretch from June to August 2026 had seven. In each cluster the price crossed the 200-day average in both directions within days, and the trades lost or gained a fraction of a percent.
Those clusters have a small cost on their own, since the fund barely moves in a day and the average loss is -0.32%. Costs make them matter. Each round trip pays the cost twice, and a trade that gains 0.02% or loses 0.04% before costs does not cover either. The cost runs below show the effect.
A buffer band around the average, which the caveat mentions, would reduce the churn. The template as tested has none, so the figures here include every cross.
Limits of the test
The window is 5.74 years, and the filter had no position until 2023-01-12 because of the 200-day warm-up and the 2021 to 2022 decline. A different window would give different entries. The result rests on 21 round trips, and 2 of them produced most of the gain.
The headline run has no fees or slippage, and the cost runs show how much a bond fund result depends on them. Trade prices are adjusted. The rule reads the close and fills at the next open, so each entry and exit sits one session after the cross. These results are hypothetical and cover past data only.
Sell and rebuy prices inside the churn
The churn clusters can be priced one exit at a time. After the sale on 2023-07-05 at 103.06 the rule bought back on 2023-07-13 at 104.02, nearly a point higher. The sale on 2023-07-28 at 103.19 was followed by a purchase on 2023-08-01 at 103.07, a few cents lower. The sale on 2023-08-02 at 102.97 was followed by a purchase on 2023-08-07 at 103.41, and the sale on 2023-08-08 at 103.64 by a purchase on 2023-08-09 at 103.68. Every one of those pairs sold at one price and bought back within days at a similar price, which is the loss a whipsaw produces.
The cleanest example is April 2024. The 141-day trade sold on 2024-04-17 at 104.19, and the filter bought again on 2024-04-18 at 104.27, one session later and higher. That second trade lost 0.14% in 8 days and the next one, bought on 2024-04-29 at 104.26, lost 0.04% in 2 days. April 2024 ended at -1.89% for the filter. The same pattern appears around the large winners. The sale on 2025-01-13 at 107.67 was followed by a buy on 2025-01-16 at 108.24, and the sale on 2026-05-15 at 115.24 by a buy on 2026-06-01 at 115.53.
By mid-2026 IEI was trading in a narrow band. Entries ran at 115.53, 115.97, 116.13, 115.98, 116.05, 115.74 and 115.94, and exits ran from 115.55 to 115.95, with the last two trades returning 0.02% and 0%. A fund that barely moves around a long average gives a trend filter many crossings and almost no gain per crossing.
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 IEI?
Over 2021-01-04 to 2026-10-02, 200-day regime filter on IEI returned 1.0% annualized vs −0.4% for buy-and-hold: it beat buy-and-hold by 1.4% per year, with a maximum drawdown 9.2 points shallower than holding (4.6% vs 13.8%).
How many trades did it make?
21 completed round trips over 5.7 years (42 fills), with 33% 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.
How did the 200-day filter do on IEI?
It turned $10,000 into $10,608 from 2021-01-04 to 2026-10-02, a CAGR of 1.03% with a maximum drawdown of 4.62%. It made 21 round trips and won 7. Holding IEI lost 0.36% a year.
Did the filter beat buy-and-hold on IEI?
Yes. It beat holding by 1.39 CAGR points, and its drawdown was 9.18 points shallower, 4.62% against 13.8%. It led in 2021, 2022 and 2026.
Why is the win rate only 33%?
Twelve of the 21 trades lasted 3 days or less and most lost a fraction of a percent. Two long trades, 256 and 484 days, produced gains of 3.12% and 6.47%. The profit factor was 2.37.
How much do trading costs matter on IEI?
A great deal. At 5 basis points the CAGR was 0.68% and at 10 it was 0.32%, against 1.03% with no costs. The rule made 42 fills on a fund that moves 0.25% in an average day.
Would a different moving average work better?
Not on this fund. The 100-day average returned 0.32%, the 150-day 0.63% and the 250-day 0.95%, against 1.03% for the 200-day. All beat holding.
How does it compare with other strategies on IEI?
It ranked 5th of 12. The trend plus trailing stop returned 1.43% and the RSI(2) snapback 1.42%, and the monthly cycle was last at -0.84%.
Is this a recommendation?
No. These are hypothetical backtests on one window, with no fees or slippage in the headline run. They describe past data only.
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.