Skip to main content
Track Trailing stop
20 / 36
Library

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.
Entries in this reading3 entries

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

Daily Citigroup on the AmiBroker sample, late November 2012 through March 2013. The 50-day EMA of the close is the slow side-of-market line; the five-day average of highs and of lows hug price and mark the breakout and the trailing exit. Points were read off the plotted curves; the last bar matches the printed status line (close 47.44, MA of highs 47.33, MA of lows 46.29, EMA 42.81).
Daily Citigroup on the AmiBroker sample, late November 2012 through March 2013. The 50-day EMA of the close is the slow side-of-market line; the five-day average of highs and of lows hug price and mark the breakout and the trailing exit. Points were read off the plotted curves; the last bar matches the printed status line (close 47.44, MA of highs 47.33, MA of lows 46.29, EMA 42.81).Citigroup · daily · 2012-11-20T00:00:00.000Z to 2013-03-22T00:00:00.000Z

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.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
20 of 36 in the Trailing stop track
201460-61 pp.Next on Trailing stopConstruct a dual quotient-copy trend filter under a frequency roofAfter higher-frequency content is isolated, a supersmoother removes remaining very high frequencies treated as aliasing noise, and the finished filter imposes a frequency-roof on what may remain.
All readings on this track · 36 readings
  1. 1988Half-day bars, a midpoint gate, and a bar-based trail
  2. 1989Packaging two-bar reversals into testable entry and exit rules
  3. 1989Weekly high and low averages as stop-and-reverse levels
  4. 1991Constant false-alarm rate for dominant-cycle stops
  5. 1992Tick-index extremes as continuation and turn hypotheses
  6. 1993Constructing layered stops from equity and structure
  7. 1993Filter crossovers with moving-average slope
  8. 1993Precommit stop bounds from equity and structure
  9. 1998Evaluating a trendline barrier that can only tighten a capped stop
  10. 1999Constructing common-number support and resistance
  11. 2001Four-step opening-hour bias and trailing stops
  12. 2004Make the trading system the star
  13. 2005A beginner stock case: stop, trail, and the pre-trade checklist
  14. 2006Sell stops that trail support after the buy
  15. 2006Treat a wave-3 label as unfunded until the stop rails are written
  16. 2008Test medium-term divergence with a trendline break and a trailing stop
  17. 2010Rule-based forex entry, stop and trail
  18. 2012Precommitting stops when one currency range templates another
  19. 2012Cat-ears as a downtrend continuation hypothesis
  20. 2013Three-average swing entry and a trailing average exit
  21. 2014Construct a dual quotient-copy trend filter under a frequency roof
  22. 2014Stop distance, size, and trailing swing invalidation
  23. 2014Long-only RSI pullback, reversal-bar-entry, and staged-trail construction
  24. 2015Dual-average regime, trigger candle, and trail as one daily script
  25. 2015Three-gate trend system: filter, trigger, and trailing stop
  26. 2016Construct HHLLS crossover and breakout entry rules
  27. 2017An appointment-trade around a scheduled political close
  28. 2017Golden-cross breakout rules for a swing entry
  29. 2017Breakout confirmation above round numbers, with nines as sell shelves
  30. 2018Classify diamond geometry before the breakout
  31. 2019When trails and stops betray the support read
  32. 2019One-triggers-the-other pairs for preplanned swing entries
  33. 2019One-triggers-the-other orders for a breakout and its stop
  34. 2019When the second decision unbounds planned risk
  35. 2020Last-Hour Breakout With a Same-Session Flatten
  36. 2020Couple the slow period to stop-loss and trailing-stop settings
All 87 readings tagged Trailing stop
Also on Trailing stop5 readings