Start with a trend rule tested since 2005.
The 200-day moving average strategy holds up to 20 large US stocks while each trades above its long-term average, and keeps the rest in cash. Inspect the recorded result, then copy the rule into your account and change any setting. No coding needed.
Free Starter access. No payment method required. Each run uses one of your three free backtests and is saved to your account with every date and assumption recorded.
200 Day Moving Average in Stocks
Recorded from to in USD, against SPY.
- Return per year
- 15.7%
- SPY 11.2%
- Total return
- 2,110.4%
- SPY 847.4%
- Deepest decline
- -56.3%
- SPY -55.2%
How the rule works
Read the return alongside volatility and the deepest decline before comparing it with anything else.
The rule
- Universe
- A fixed list of 116 large US stocks.
- Signal
- Each week, stocks trading above their 200-day simple moving average qualify. Stocks already held get priority.
- Sizing
- Up to 20 positions at 5% of the portfolio each, with a 2% rebalance band. Unused allocation stays in cash.
- Costs
- Commission, spread and slippage are applied to every simulated trade.
Return and risk
| Metric | Recorded example | SPY |
|---|---|---|
| Total Returns | 2,110.4% | 847.4% |
| Annualized Returns | 15.7% | 11.2% |
| Volatility | 20.5% | 19.1% |
| Max Drawdown | -56.3% | -55.2% |
Model holdings on
The first ten positions are shown. These are model positions. PyInvesting does not connect to a brokerage or place orders.
See every position and trade| Asset | Weight |
|---|---|
| ADP | 4.9% |
| AMD | 5.4% |
| AMGN | 5.1% |
| BDX | 4.8% |
| BMY | 4.7% |
| CRM | 4.6% |
| CSCO | 5.3% |
| CSX | 5.3% |
| HUM | 6.8% |
| INTC | 4.5% |
| Cash | 0% |
What to check in your result
- Dates and coverage
- Read the actual calculation dates and how much price history was available for each instrument.
- Return against risk
- Compare returns with the benchmark, then look at the deepest decline. A higher return often comes with deeper falls along the way.
- Selection and costs
- A list of stocks chosen today can favor past winners. Taxes, spreads and your own execution can change the outcome.
These are educational examples, not recommendations or forecasts. A backtest does not prove future profitability.