Skip to content
Back to strategies

Storm Shelter

Holds a broad U.S. stock fund above its 200-day price average. Below it, switches to a fund of consumer staples such as food and household goods.

Backtest this strategyFree account required
RiskHolding timeFor players who want
MediumMonths to YearsA rule for switching stock funds

How it works

SPY's price trend chooses between two stock funds.

Above the average SPY tracks the S&P 500, a group of large U.S. companies. When SPY's closing price is above its 200-day average, the strategy holds SPY.

Below the average When SPY closes below its average, the strategy switches to XLP. This fund holds consumer-staples companies, which sell goods such as food and household products. XLP can still lose money.

Targets one fund at a time. Checks each trading close. Switches fill at the next trading open. The rule does not check XLP's own price trend.

Rules at a glance

Eligible assets
Fixed list: SPY, XLP.
Schedule
Checks its rule at every trading close.
Money split
All the money in one asset.
Automatic loss limit
None.
DetailWhat it means
HoldsSPY or XLP, one stock fund at a time
StyleSwitches funds using SPY's price trend
Trade timingChecks each trading close; switches at the next open
Money splitTargets 100% in the selected fund
RiskMedium
Automatic loss limitNone; a weaker SPY trend selects XLP

What to watch out for

  • Both choices are stock funds. XLP can fall alongside SPY. Switching to consumer staples does not guarantee a smaller loss.
  • XLP concentrates the money in one sector. The rule can buy or keep XLP while its own price is falling.
  • Switches can reverse. When SPY stays near its average, repeated changes can sell one fund and buy the other at unfavorable prices.

Source

Uses the S&P 500 fund's price trend to switch between broad U.S. stocks and consumer staples.

Full rulebook

1. Strategy overview

  • Name: Storm Shelter
  • Goal: Target SPY when SPY closes above its 200-day average, and XLP when it closes below.
  • Idea: Respond to a weaker broad-market trend by changing the stock fund held.

2. Investments it can hold

  • SPY: SPDR S&P 500 ETF Trust, a fund of large U.S. companies
  • XLP: Consumer Staples Select Sector SPDR Fund, a fund of consumer-staples companies
  • An ETF is a fund that trades on an exchange like a stock.
  • The choice is fixed to these two funds.

3. Data and schedule

  • Data: SPY's daily closing prices; no company financial data
  • History needed: 200 trading days
  • Check: after every trading day's close
  • Trades: when the target changes, at the next trading day's open

4. When it buys

  1. Calculate the simple average of SPY's last 200 closing prices, including today.
  2. Above that average, target SPY. Below it, target XLP.
  3. On an exact tie, keep SPY if it is already held. Otherwise target XLP, including when starting with neither fund.
  4. When a switch is needed, sell the current fund and buy the target at the next trading day's open.
  • If SPY's close or average is unavailable, keep whichever fund is held. If neither is held, keep cash.
  • Maximum holdings: one fund
  • When you start: apply the same rule to that day's close and fill any purchase at the next trading open.

5. When it sells

  • Sell a fund when the daily rule selects the other fund.
  • The normal price rule switches between SPY and XLP. It does not select cash during a market fall.
  • Time limit: none

6. How it divides the money

  • Target: 100% in the selected fund
  • Cash: rounding leftovers and dividend cash can remain between switches. There is no scheduled reset to invest them while the target stays the same.
  • Stop loss: none. A decline in either holding does not trigger a separate percentage-loss sale.
  • Take profit: none

7. Moon's notes

  • Every signal uses SPY's price and average. XLP's own trend does not affect selection.
  • The target describes the intended allocation. Cash can still exist before the first purchase, from missing data, rounding or dividends.
  • Dividends on shares held at the previous close enter cash on the ex-dividend date. This is the first day a new buyer no longer qualifies for that dividend, and it can be earlier than payment day.