2006issue C121-11
A stochastic oscillator gated by a long-term exponential average
This construction lesson pairs a smoothed stochastic oscillator with a 271-period exponential average of the close so the average can permit a setup and can also force an exit.
- Long entries fire when the stochastic reading is below 30 and the close is above the 271-period exponential moving average.
- Short entries fire when the stochastic reading is above 70 and the close is below that same average.
- Either side exits when the oscillator reaches the opposite threshold or when the close crosses back through the average.
- The oscillator uses a 7-period raw calculation and a 3-period smoothing term, and all four rules are evaluated on the close.
Two roles in one rule set
The construction joins a bounded oscillator to a slow exponential average of closing prices. The oscillator locates the latest close inside a recent high-low range, then smooths that reading so oversold and overbought crossings can be treated as explicit entry and exit thresholds.
The moving average is a 271-period exponential average of the close. It supplies the long-horizon trend line used both as a permission filter and as an independent exit condition.
How the trend filter admits a setup
The trend filter admits long setups only when price is above the average and short setups only when price is below it. It can also force an exit when price crosses back through the average.
SMAF-1 cumulative return versus the S&P 500

AIQ tested the long side only, with extra market-index and group filters and a five-position stock book, not the bare single-instrument long/short rules. Path values between labeled dates are approximate raster readings.
Oscillator lookback and thresholds
The stochastic component is specified with a 7-period raw calculation and a 3-period smoothing term.
One implementation encodes the 30 and 70 thresholds as a 20-point band around the oscillator midpoint of 0.5.
Long entry and exit
Long entries fire when the stochastic reading is below 30 and the close is above the 271-period exponential moving average.
Long positions exit when the stochastic reading rises above 70 or the close falls below the 271-period exponential moving average.
Short entry and exit
Short entries fire when the stochastic reading is above 70 and the close is below the 271-period exponential moving average.
Short positions exit when the stochastic reading falls below 30 or the close rises above the 271-period exponential moving average.
Evaluated on the close
All four entry and exit rules are evaluated on the close, so the system can be stated as a fully mechanical rule set without discretionary overlays.
All readings on this track · 33 readings
- 1988Opening-range brackets, a two-bar trend filter, and bounded stops
- 1990Bezier-curve price trend filter
- 1992Constructing a damping-index trend filter
- 1992Building a random walk index trend filter
- 1992Phase diagrams for moving-average trend filters
- 1993Volume-weighted change smoothing and trend ranking
- 1993Concurrent highest-low filter with a largest-low-fall trigger
- 1994Unit-invariant trend filters and the c-test
- 1995Constructing cup and cap entries with a three-bar net line
- 1997Why a daily timing evaluation depends on interval, lookbacks, and the fitting objective
- 2001A volume budget clock for trend-segment construction
- 2001Keep three jobs separate when you test a composite score
- 2002Evaluating the weekly four-percent close filter as a market-state procedure
- 2003Constructing a confirmed zigzag trend filter
- 2004Decompose high, low, and close into separate forecast streams
- 2005Three-state moving-average breakout bar coloring
- 2005Constructing a volume and move-adjusted trend filter
- 2005A fifty-day average breakout as a trend permission filter
- 2005Current-bar inclusion can mute a stochastic channel break
- 2006A stochastic oscillator gated by a long-term exponential average
- 2010A construction test for a modified volume-price trend filter
- 2011Constructing a Spearman rank trend filter
- 2013Constructing a repeated-median slope as a resistant trend filter
- 2014Combining a relative-strength index and trend filters for oversold setups
- 2014Price-rooted lookbacks for a relative strength index, a moving average, and a trend filter
- 2015Evaluating next-session intermarket range forecasts
- 2018Read the intermarket weight matrix first, then the predicted moving-average filter
- 2018Constructing the stiffness trend filter from moving-average holds
- 2018The averaging kernel and the lagged trend gate are separate specifications
- 2019A trend filter is not ready to compare until portfolio constraints are written down
- 2019Lookback, threshold, and position-capacity for a stiffness trend-filter
- 2020Combining a trend filter with a moving average and a stochastic oscillator
- 2020Constructing a relative-strength oscillator with a rank-agreement trend filter