# Trend following bot: Faber’s 10-month moving average

> A trend following bot that holds SPY above its 10-month moving average and Treasury bills below. See the backtest, then run it on paper or with Alpaca.

Written by [Tactfolio research team](https://tactfolio.com/about/editorial-policy.md), published 2026-10-16, updated 2026-10-16, data as of 2026-09-25.

A trend following bot holds an asset while its price trend is up and steps aside when it turns down. This template runs Mebane Faber's 10-month moving average rule on the S&P 500: hold SPY above the average, hold Treasury bills below it. You can read every rule, check the backtest, and run it on paper or in your own Alpaca account.

## Key points

- The bot checks once a month and holds either SPY or BIL, a Treasury bill fund.
- It holds stocks while the S&P 500 is above its 10-month moving average.
- In the backtest it cut the S&P 500's worst drawdown by more than half.
- It finished 2008 slightly positive, but lost to the market in choppy years like 2010.
- You run your own copy, and you choose the balance it trades.

## What does the trend following bot do?

The bot follows one rule from Faber's 2007 paper, "A Quantitative Approach to Tactical Asset Allocation". A **moving average** is the average price over a set time. Here it is the average of the last ten month-end closes.

At the close of the last trading day of each month:

- If SPY is above its 10-month moving average, hold SPY.
- If it is below, hold BIL.

The rule does not try to predict anything. It accepts that it will sell late and buy back late. The goal is to miss the middle of a long decline. The full rules, sources and yearly results are in [Faber's 10-month moving average timing model](https://tactfolio.com/strategies/faber-10-month-moving-average.md).

## How did trend following do in the backtest?

These figures come from the strategy's article and were measured on prices through September 25, 2026.

- Over the ETF era it compounded at about 8% a year, the same as a 60/40 portfolio.
- It cut the S&P 500's worst drawdown by more than half. A drawdown is how far a portfolio falls from its last high point.
- It finished 2008 slightly positive after leaving stocks early in the year, while the S&P 500 lost more than a third.
- In 2010 it lost about 2% while the S&P 500 gained 15%, because prices kept crossing the average.
- It also fell far behind in 2019 and 2023, when it sold into a decline and bought back after much of the rebound.

These are hypothetical backtests on past prices after trading costs, not a track record. [Why past results mislead](https://tactfolio.com/docs/concepts/why-past-results-mislead.md) explains the traps.

## How to run the trend following bot on Tactfolio

Five steps take you from the rule to a running bot.

1. **Open the live strategy.** Open the [live trend following strategy](https://tactfolio.com/s/tactfolio/faber-sp500-timing) to see its rule and its daily-updated backtest.
2. **Copy it to your account.** Sign up for free and copy it. Your copy is yours to change.
3. **Change it if you want.** In the [builder](https://tactfolio.com/builder), try a different average length or a different market. The backtest reruns as you edit.
4. **Run it on paper.** In Trade, a paper account runs the bot with pretend money at real market prices and emails you a summary after each close.
5. **Connect Alpaca when you are ready.** Use your own Alpaca account, paper or live, with your own API keys. The bot trades only the starting balance you give it.

## When does the trend following bot struggle?

- **Fast crashes and rebounds.** A monthly check on a slow average reacts too late to a crash that reverses within weeks.
- **Sideways markets.** Prices crossing back and forth around the average cause repeated small losses, called whipsaws.

## Common questions

### What is a trend following bot?

It is a bot that holds an asset while its trend is up and moves to cash when the trend turns down. This one uses a 10-month moving average on the S&P 500.

### Is the 10-month moving average the same as the 200-day?

Not quite. Faber's average uses one price per month, while the [200-day moving average](https://tactfolio.com/strategies/200-day-moving-average.md) uses 200 daily closes. They look back over a similar stretch, but the 10-month version changes only at month end.

### How often does the trend following bot trade?

It checks once a month and trades only when the price has crossed the average since the last check. In a steady trend it can hold the same fund for years.

### Can I use trend following on other funds?

Yes. Copy the strategy and swap SPY for another fund. Faber also applied the same rule to five asset classes in his [Global Tactical Asset Allocation](https://tactfolio.com/strategies/global-tactical-asset-allocation.md) portfolio.

## The ideas behind this bot

- [Trend following](https://tactfolio.com/learn/trend-following.md): What trend following is, the research back to 1880, five classic ETF trend rules with dated backtests, and the whipsaws and flat years that come with it.
- [Moving averages](https://tactfolio.com/learn/moving-average.md): What a moving average is, SMA vs EMA with a 5-day example, the 200-day average, golden and death crosses, and dated backtests of classic rules.
- [Max drawdown](https://tactfolio.com/learn/max-drawdown.md): Max drawdown is the biggest fall from a peak to a low.
- [SPY: State Street SPDR S&P 500 ETF Trust](https://tactfolio.com/etf/spy.md): What SPY holds, its 0.0945% yearly fee, returns by year, its worst drop, and which Tactfolio strategies hold it.
- [BIL: State Street SPDR Bloomberg 1-3 Month T-Bill ETF](https://tactfolio.com/etf/bil.md): What BIL holds, its 0.1353% yearly fee, returns by year, its worst drop, and which Tactfolio strategies hold it.

## Sources

- [A Quantitative Approach to Tactical Asset Allocation (2007, updated 2013)](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=962461), Mebane Faber, SSRN, accessed 2026-10-16
- [Paper Trading](https://docs.alpaca.markets/docs/trading/paper-trading/), Alpaca, accessed 2026-10-16
