Skip to main content
Track Breakout system
2 / 23
Library

1995issue C061-3

Write a weekly breakout as one parameterized entry and exit

This archive article shows how to write a weekly long entry and exit as one parameterized rule set. The entry pairs a five-bar high break with a higher-low filter, and the exit waits for a retracement ratio and a trend analysis index to meet their cutoffs on the same bar.

  • A long entry pairs a five-bar high break with a higher-low filter that requires the five-bar low to sit above the thirteen-bar low.
  • A long exit requires a retracement ratio above its cutoff and a trend analysis index below its cutoff, both true on the same bar.
  • Lookbacks 5, 13, and 26 and the two exit cutoffs stay replaceable so the same parameterized rule set can be optimized later.
  • Fills use close-bar execution on weekly bars, at the close of the bar that first meets the buy or sell predicate.
Entries in this reading3 entries

The construction in one procedure

The archive writes a weekly long entry and a weekly long exit as one procedure. The entry is a five-bar high break that is allowed only when a higher-low filter is also true. The exit is a joint test: the retracement ratio must be above a cutoff and the trend analysis index must be below a cutoff on the same bar. Fills follow close-bar execution.

How the long entry is written

A long entry requires a new five-bar high together with a five-bar low that is above the thirteen-bar low.

The five-bar high break is the breakout half of that entry: the current high is a new high of the latest five bars. The higher-low filter is the other half: the latest five-bar low sits above the thirteen-bar low, so the breakout is allowed only when the short-window low has already lifted.

How the long exit is written

A long exit requires a retracement ratio above a cutoff and a trend analysis index below a cutoff, both true on the same bar.

The retracement ratio is how far the current low sits below the thirteen-bar highest low, expressed as a fraction of the current low. It is written as the thirteen-bar highest low minus the current low, divided by the current low.

The trend analysis index is the five-bar high-to-low span of a twenty-six-bar close average, divided by the close and scaled by one hundred. It is written as the five-bar range of a twenty-six-bar close average, divided by the close and multiplied by 100.

Lookbacks and cutoffs as replaceable inputs

Lookbacks 5, 13, and 26, plus the two exit cutoffs, are written as replaceable parameters so the same procedure can be optimized. That keeps the same entry and exit predicates, with lookbacks and cutoffs exposed as replaceable inputs for a later optimization pass.

Exit cutoffs are not unique across encodings: retracement tests appear as 0.05, 0.06, or 0.07 and trend-index tests as 1.0 or 1.2.

Close-bar execution on weekly bars

Fills are specified at the close of the bar that meets the buy or sell predicate. That is close-bar execution: a fill taken at the close of the bar that first satisfies the buy or sell predicate.

The construction is specified on weekly bars over a sample from the start of April 1982 through the end of March 1995.

Weekly S&P 500 and system equity, April 1983–late 1994

The upper series is weekly S&P 500 closes rising from the mid-140s to about 502. The lower series is the SMARTrader equity line on a close-to-close, trade P/L basis, stepping from near zero to the high 300s. Values were read off Figure 1; the source printed no table.
The upper series is weekly S&P 500 closes rising from the mid-140s to about 502. The lower series is the SMARTrader equity line on a close-to-close, trade P/L basis, stepping from near zero to the high 300s. Values were read off Figure 1; the source printed no table.S&P 500 · weekly · 1983-04-08T00:00:00.000Z to 1994-11-30T00:00:00.000Z

Weekly bars from early April 1982 through end-March 1995; the printed frame starts mid-1983. Entry and exit cutoffs differ slightly across vendor listings. Digitizing is approximate.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
2 of 23 in the Breakout system track
19951-12 pp.Next on Breakout systemCombining a trend rule, a breakout trigger, and a seasonal filterEarly computerized trend-following fit commodity markets that still moved in an orderly way. Later market-noise made the same simple rules harder to apply.
All readings on this track · 23 readings
  1. 1995Range breakout rules with an expansion filter and moving-average exits
  2. 1995Write a weekly breakout as one parameterized entry and exit
  3. 1995Combining a trend rule, a breakout trigger, and a seasonal filter
  4. 1996Constructing a two-bar clearance breakout from a twenty-session exponential average
  5. 1996Two-bar exponential-average breakout as setup, stop, and flatten
  6. 1998A noise-offset breakout judged after walk-forward re-estimation
  7. 1998Gating a weekly average crossover with stored support and resistance
  8. 1998Moving-average candidates gated by support and resistance
  9. 2000Constructing next-close envelope targets for breakout stops
  10. 2001February soybean high breakout and June trailing stop
  11. 2005Box-and-breakout states written as ordered entry and exit rules
  12. 2007Match trend and breakout rules to the market condition
  13. 2010How a JM internal band becomes long and short entry and exit rules
  14. 2013Constructing a three-average trend-aligned breakout system
  15. 2016Volume-confirmed breakout entry rules
  16. 2017How to construct exponential standard deviation bands
  17. 2017Four-day green candle breakout as one swing procedure
  18. 2018Constructing inverse ETF breakouts above a 200-day average
  19. 2018Evaluating trend, breakout, and regression rules by average robustness
  20. 2019A crypto pair breakout after a sideways range
  21. 2019Next-session breakout rules after a high-volume close
  22. 2020Altcoin dual-stop breakout with a timed exit
  23. 2020Critiquing required stops in mechanical breakout systems
All 74 readings tagged Breakout system
Also on Breakout system5 readings