2005issue C091-6
How to write a short moving-average pullback as one procedure
A short moving-average pullback can be written as one testable procedure: first confirm a declining market and a defined pullback setup, then require a trigger, a stochastic filter, and a fixed holding period before any exit is allowed.
- The short procedure combines a downtrend test, a moving-average pullback setup, a lower-low trigger, a volume floor, and a stochastic filter into one signal.
- A setup is complete only when the pullback average has not been crossed from below for the not-above window and close is within one percent of that average.
- Entry is delayed one bar after setup and requires the current low to break the prior low while the prior-bar stochastic reading stays below 80.
- The coded holding period is three bars, with a cover scheduled after three sessions rather than by a price target.
What the procedure requires
The archive describes a short procedure that waits for price to stay below a moving average, then recover toward that average, before a downside trigger is allowed. That pullback sits inside a checklist of market-state, setup, trigger, filter, and holding-period conditions that must all be true before a short is taken or closed.
The short procedure combines a downtrend test, a moving-average pullback setup, a lower-low trigger, a volume floor, and a stochastic filter into one signal.
Published lookbacks and the setup test
The published default lookbacks include a 5-bar highest close, a 20-bar lowest close, a 20-bar lower-close comparison, a 35-bar pullback average, and a 15-bar not-above test.
A setup is complete only when the pullback average has not been crossed from below for the not-above window and close is within one percent of that average.
Trigger, stochastic filter, and the hold
Entry is delayed one bar after setup and requires the current low to break the prior low while the prior-bar stochastic reading stays below 80. The stochastic oscillator is used here only as a bounded oscillator of recent price position and only as a prior-bar filter, not as a standalone forecast.
The coded holding period is three bars. A cover is scheduled after three sessions rather than by a price target.
IBM daily short moving-average pullback, March–April 2005

Values digitized from the eSignal daily IBM chart. Price bars are summarized by selected closes; the two overlays follow the labeled moving-average paths. Raster resolution limits precision to about 0.2–0.5 points.
Liquidity screens and optional gates
Liquidity screens in the supplied implementations use a 15 price floor and a volume threshold that is 200000 on daily data or 2000 on locally stored data.
One implementation adds a separate market-state gate that enables shorts only when an index is classified as bearish from recent peak and trough trendlines. A hard minimum-price filter can drop historically valid names after split adjustment, so that screen is treated as an optional constraint rather than a required rule.
All readings on this track · 10 readings
- 1997A two-gate held-out test of hand-labeled pullback nets
- 2004A 50-day average touch as a screening procedure
- 2005Write a moving-average pullback as one procedure
- 2005How to write a short moving-average pullback as one procedure
- 2007Failed-breakout shorts with a half-width exit
- 2008Three-gate pullback entries from exchange tick breadth
- 2010Clear-method noise alerts for swing entries and exits
- 2011Same pullback rules, different market modes
- 2012Pixel-grid pullback and sector color alignment
- 2013Untested pullback entries need quantified exits