2013issue C1253-56
Three-average swing entry and a trailing average exit
A swing template is a construction problem: lock three moving-average roles, write long, short, and stay-out as one bar-by-bar procedure, then decide what a trailing stop is allowed to follow before any platform copy is run.
- Lock the three moving-average roles first: a five-bar average of highs, a five-bar average of lows, and a 50-bar exponential average of the close, each as a comparable level rather than a next-print forecast.
- A rule-based entry is the full long, short, or stay-out test on every bar. A long needs the close to clear the five-bar high average by a tick offset and the prior close already above the 50-bar exponential average. The short is the mirror.
- The trailing stop follows the five-bar average of lows for longs and the five-bar average of highs for shorts, so exit distance stays tied to recent range instead of a fixed tick count.
- Scanner alerts and a backtest can share one procedure. Later filters and a later fill rule were added after the unfiltered original was described as trigger-happy. That sequence is archive workflow, not a present-day result.
Lock the three average roles
Archive implementations reconstruct one swing procedure from three moving averages: a five-bar average of highs, a five-bar average of lows, and a 50-bar exponential average of the close.
Each moving average is a lookback smoother of ordered highs, lows, or closes. It supplies a comparable level rather than a forecast of the next print.
Editorial view: lock those roles before any platform copy is run. Later work can change a length or an offset without rewriting what each average is allowed to mean.
Three averages on daily Citigroup

AmiBroker tip uses a 5-day simple average of highs, a 5-day simple average of lows, and a 50-day EMA of the close. Longs fire when close crosses the high average plus 0.05 with the prior close above the EMA; the low average is the trailing stop. Weekly samples from the screenshot, so short wiggles in the 5-day averages are omitted.
Write entry and stay-out as one procedure
A long entry is defined only when the close clears the five-bar high average by a tick offset and the prior close already stood above the 50-bar exponential average. The short is the mirror image.
If those joint conditions are not met, the procedure stays out. That complete long, short, or stay-out test is the rule-based entry, and it can be applied the same way on every bar.
Editorial view: abstention belongs in the same procedure as the two entries. Splitting stay-out into a later filter makes the scanner and the backtest easy to drift apart.
Decide what the trailing stop may do
The long exit is a trailing close when price trades at or below the five-bar average of lows. The short exit is the symmetric trail against the five-bar average of highs.
In this template the trailing stop follows the five-bar average of lows for longs and the five-bar average of highs for shorts, so the exit distance stays tied to recent range instead of a fixed tick count.
Editorial view: grant that permission before the first platform copy. The stop is not free to pick a new distance on each bar except by following those two averages.
Keep one procedure across copies
One vendor implementation folds the three averages and the same entry-exit rules into a single indicator so scanner alerts and a separate backtest strategy can share one procedure.
A second implementation exposes tick offset, exponential-average length, and label colors as chart parameters so the same rule skeleton can be retuned without rewriting the entry logic.
Filters came after the unfiltered test
A portfolio backtest of the unfiltered original rules on Dow 30 daily bars, five years, and 5% equity per trade, with no costs, was described as trigger-happy, with large drawdown and losses on the short side.
Leaving the average lengths unchanged, two extra filters were added: a 50-day high/low recency trend filter, and a two-bar reaction against the five-bar high or low average before a breakout is accepted.
A later variant keeps the same three-average skeleton, sizes the breakout offset with average true range, adds NASDAQ 100 trend filters, and fills at the next open after a close-based signal.
In that later comparison, neither the original short rules nor the modified short rules were described as profitable, though the modified short book was said to lose less in total.
All readings on this track · 36 readings
- 1988Half-day bars, a midpoint gate, and a bar-based trail
- 1989Packaging two-bar reversals into testable entry and exit rules
- 1989Weekly high and low averages as stop-and-reverse levels
- 1991Constant false-alarm rate for dominant-cycle stops
- 1992Tick-index extremes as continuation and turn hypotheses
- 1993Constructing layered stops from equity and structure
- 1993Filter crossovers with moving-average slope
- 1993Precommit stop bounds from equity and structure
- 1998Evaluating a trendline barrier that can only tighten a capped stop
- 1999Constructing common-number support and resistance
- 2001Four-step opening-hour bias and trailing stops
- 2004Make the trading system the star
- 2005A beginner stock case: stop, trail, and the pre-trade checklist
- 2006Sell stops that trail support after the buy
- 2006Treat a wave-3 label as unfunded until the stop rails are written
- 2008Test medium-term divergence with a trendline break and a trailing stop
- 2010Rule-based forex entry, stop and trail
- 2012Precommitting stops when one currency range templates another
- 2012Cat-ears as a downtrend continuation hypothesis
- 2013Three-average swing entry and a trailing average exit
- 2014Construct a dual quotient-copy trend filter under a frequency roof
- 2014Stop distance, size, and trailing swing invalidation
- 2014Long-only RSI pullback, reversal-bar-entry, and staged-trail construction
- 2015Dual-average regime, trigger candle, and trail as one daily script
- 2015Three-gate trend system: filter, trigger, and trailing stop
- 2016Construct HHLLS crossover and breakout entry rules
- 2017An appointment-trade around a scheduled political close
- 2017Golden-cross breakout rules for a swing entry
- 2017Breakout confirmation above round numbers, with nines as sell shelves
- 2018Classify diamond geometry before the breakout
- 2019When trails and stops betray the support read
- 2019One-triggers-the-other pairs for preplanned swing entries
- 2019One-triggers-the-other orders for a breakout and its stop
- 2019When the second decision unbounds planned risk
- 2020Last-Hour Breakout With a Same-Session Flatten
- 2020Couple the slow period to stop-loss and trailing-stop settings