Skip to content
Browse the docs

Strategy patterns

Trend following

Be in while prices have been rising and out while they have been falling, judged by moving averages.

On this page

What it is

A trend rule holds a share or fund while its price is above a moving average, or while a faster average is above a slower one, and holds cash otherwise.

It does not try to buy at the bottom. It waits for a rise to show up in the averages, then holds until a fall shows up.

How to write it

Each example opens in the Strategy Agent with the words typed in. Nothing is sent until you press its button.

Try in the Strategy Agent

Golden cross strategy on SPY over the last 10 years

Try it: open the Strategy Agent with these words typed in, unsent
Try in the Strategy Agent

Moving average crossover on SPY over the last 5 years

Try it: open the Strategy Agent with these words typed in, unsent
Try in the Strategy Agent

Buy SPY when the close is above its 200-day SMA; sell when the close is below its 200-day SMA, over the last 10 years

Try it: open the Strategy Agent with these words typed in, unsent
Try in the Strategy Agent

Golden cross on QQQ, only taking trades while SPY is above its 200 day average, over the last 10 years

Try it: open the Strategy Agent with these words typed in, unsent

Its recorded tests

The evidence explorer runs rules like these across fixed sets of US, UK and European shares and funds, with the same costs throughout, and sets each beside simply holding. See the trend (moving averages) tests.

Templates in the community library:

  • Golden cross on SPY: Own the S&P 500 while its 50-day average is above its 200-day average, and sit in cash when it isn't.
  • SPY above its 10-month average: Hold the S&P 500 while it closes above its roughly 10-month (210-day) moving average, otherwise cash.
  • Golden cross on QQQ: Own the Nasdaq 100 while its 50-day average is above its 200-day average, and sit in cash when it isn't.
  • Golden cross on the total US market: Own VTI (the whole US stock market) while its 50-day average is above its 200-day average.
  • Small-cap golden cross on IWM: Own US small caps (IWM) only while their 50-day average is above the 200-day average.
  • Tech sector golden cross on XLK: Own the technology sector ETF while its 50-day average is above its 200-day average.
  • Gold trend: 20/100-day crossover on GLD: Hold gold (GLD) while its 20-day average is above its 100-day average; a faster trend rule than the golden cross.

What to watch for

  • It sells after a fall has begun and buys back after a rise has begun, so it misses the start of each move.
  • When prices go up and down in a narrow range, it can buy and sell often, paying costs each time.
  • Out of the market means in cash, so it can trail simply holding while prices climb steadily.

The rules it uses

These pages describe how Quantis Trade works and what its tests show about the past. They are not forecasts and not advice.