Skip to content
Browse the docs

Strategy patterns

Breakouts

Buy when the price closes at a new high for its recent past, and sell at a new low or on a stop.

On this page

What it is

A breakout rule buys when the close is the highest of the last so many trading days, on the idea that a new high can start a move, and sells at a new low for the same number of days.

A gap at the open, when a share opens well above the day before, is a related signal.

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

Breakout strategy on GLD over the last 5 years

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

20-day breakout strategy on Nvidia over the last 5 years

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

Buy SPY on a 20-day breakout if it's above its 50-day EMA, 8% trailing stop. Backtest over 10 years.

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

Buy Nvidia when it gaps up 2% and sell when it closes back below the gap, over the last 2 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 breakout (donchian) tests.

Templates in the community library:

  • 20-day breakout on SPY: Buy the S&P 500 when it closes at a new 20-day high, and exit when it closes at a new 20-day low.
  • Turtle-style 55-day breakout on gold: Buy GLD on a close above its 55-day high and exit on a close below its 55-day low.
  • 20-day breakout on NVIDIA: Buy Nvidia when it closes at a new 20-day high, and exit when it closes at a new 20-day low.

What to watch for

  • A new high can be followed by a fall back; the rule buys each one and pays costs each time.
  • A longer channel trades less often and waits longer before it sells.

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.