Skip to content
Strategies

The 200-day moving average strategy: rules, evidence, and a backtest

Define a moving-average allocation rule, specify signal and execution timing, and inspect its tradeoffs in a model run. An illustrative prompt helps you build and compare your own version.

By Updated Published 2 min read

A moving-average allocation rule compares an asset's price with an average of its earlier prices. It holds the asset when the signal is positive and uses a specified alternative when it is not. The rule is easy to describe, but its timing and data choices need to be precise.

Define the illustrative rule

This example uses SPY as the equity holding and BIL as the alternative:

  1. At each month-end decision, calculate the mean of the latest 200 available trading-day closes.
  2. Choose SPY when its closing price is above that mean; otherwise choose BIL.
  3. Execute no earlier than the next available session after the signal is known.
  4. Specify the price basis, warm-up period, missing-data treatment and costs.

BIL is an ETF holding, not cash in a brokerage account. A 200-day average differs from a 10-month average of month-end prices. Do not treat their results as interchangeable.

Inspect the tradeoffs

A rule can move out of a holding during a sustained decline, but it can also sell after a fall and miss a rebound. Repeated crossings can create whipsaws and trading costs. Neither a smaller drawdown nor a higher return follows from the rule alone.

For broader research context, A Century of Evidence on Trend-Following Investing studies trend following. Its assets and methods are separate from this illustrative ETF prompt; its results are not evidence of a specific ENSEMBLE run.

Build, inspect and compare

The prompt is a proposed specification, not a recorded result. Review the generated code in your own model and verify that decisions cannot use future data. Build time depends on the requested work and runtime conditions.

Inspect the successful run's window, data date, warnings, allocation changes and drawdowns. Compare with SPY over the same dates. Do not assume a fixed time in market, trade count or drawdown improvement.

Test one change at a time: a different lookback, weekly evaluation, or an explicit entry/exit buffer. Keep other choices fixed. Use saved test runs and inspect the differences before adopting new defaults. The portfolio walkthrough explains that process; metrics explained describes the current reporting conventions.

Maintain the reviewed allocation

Enable automatic refreshes only after reviewing the model. Check that a refresh succeeded and inspect its latest data date before using its allocation. A model's output is research; it does not submit brokerage orders.

ENSEMBLE is research software. Backtests are hypothetical and past performance does not guarantee future results.

Frequently asked questions

Is a 200-day average the same as a 10-month average?
No. They use different observations and can produce different signals. State the sampling frequency and lookback explicitly before comparing them.
Does this strategy beat buy and hold?
That requires a particular dataset, window and implementation to evaluate. This page makes no performance claim for the illustrative prompt. Compare a saved run with a benchmark over identical dates.
Why evaluate only at month end?
It is one explicit scheduling choice. Less frequent decisions may reduce some trading but also delay responses. Test the difference rather than assuming a benefit.

Related

Backtests are illustrative. Past performance does not guarantee future results. ENSEMBLE is a software platform, not an investment adviser.

Part of Systematic strategies, explained and backtested.

Backtest this strategy on ENSEMBLE.Run this backtest