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.
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

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.
All readings on this track · 23 readings
- 1995Range breakout rules with an expansion filter and moving-average exits
- 1995Write a weekly breakout as one parameterized entry and exit
- 1995Combining a trend rule, a breakout trigger, and a seasonal filter
- 1996Constructing a two-bar clearance breakout from a twenty-session exponential average
- 1996Two-bar exponential-average breakout as setup, stop, and flatten
- 1998A noise-offset breakout judged after walk-forward re-estimation
- 1998Gating a weekly average crossover with stored support and resistance
- 1998Moving-average candidates gated by support and resistance
- 2000Constructing next-close envelope targets for breakout stops
- 2001February soybean high breakout and June trailing stop
- 2005Box-and-breakout states written as ordered entry and exit rules
- 2007Match trend and breakout rules to the market condition
- 2010How a JM internal band becomes long and short entry and exit rules
- 2013Constructing a three-average trend-aligned breakout system
- 2016Volume-confirmed breakout entry rules
- 2017How to construct exponential standard deviation bands
- 2017Four-day green candle breakout as one swing procedure
- 2018Constructing inverse ETF breakouts above a 200-day average
- 2018Evaluating trend, breakout, and regression rules by average robustness
- 2019A crypto pair breakout after a sideways range
- 2019Next-session breakout rules after a high-volume close
- 2020Altcoin dual-stop breakout with a timed exit
- 2020Critiquing required stops in mechanical breakout systems