2004issue C041-10
Piecewise trend quality from moving-average reversals
Trend quality is assembled in order. A moving-average reversal-gate is allowed to reset state, a piecewise-exponential-smooth must not leak across that reset, and only then are residual-noise, the quality-reading, and the balance-reading formed so each term can be checked.
- The reversal-gate is a signed flag from a fast and a slow moving average of the close. A change in that flag starts a new trend segment.
- Cumulative-price-change adds signed close-to-close increments only inside the current segment and is cleared to zero when the gate flips.
- The piecewise-exponential-smooth of that accumulator is restarted at each crossover so one segment cannot bleed into the next. Residual-noise is then taken from the gap and scaled.
- The quality-reading is the piecewise trend divided by residual-noise when that noise estimate is positive. The balance-reading is the absolute piecewise trend as a share of absolute trend plus noise, usually scaled from 0 to 100.
Build the trend-filter in order
A trend-filter here is the assembled construction that converts ordered closes into a segmented strength and balance forecast rather than a raw price average.
The archive workflow builds that object in pieces. First a moving-average reversal-gate is allowed to reset state. Then a piecewise-exponential-smooth is applied to a segment accumulator and must not leak across that reset. Only afterward is a trend-to-noise ratio formed.
Start with a reversal-gate
A fast and a slow moving average of the close create a signed reversal flag. A change in that flag marks the start of a new trend segment.
Worked reconstructions pair a 7-period fast exponential average with a 15-period slow exponential average as the default reversal-gate.
Keep cumulative-price-change inside one segment
Inside a segment, cumulative-price-change adds each signed close-to-close increment. When the reversal flag changes, that accumulator is reset to zero.
Some reconstructions keep a separate up-segment accumulator and down-segment accumulator and then join them, so a directional restart cannot carry the tail of the opposite run.
Restart the piecewise-exponential-smooth
The trend term is a piecewise-exponential-smooth of the segment accumulator, commonly using a 4-period span. The smoother is restarted at each crossover so one segment cannot bleed into the next.
Form residual-noise from the gap
Residual-noise is taken from the gap between the segment accumulator and the piecewise trend, then scaled by a correction factor. The default noise lookback is 250, and 2 is a common scale.
The noise term is not unique. One family uses a root-mean-square of squared residuals. Another uses a simple average of absolute residuals. Both are then multiplied by the same style of correction factor.
Only then form the quality-reading and balance-reading
The quality-reading is the piecewise trend divided by the noise estimate whenever that noise estimate is positive.
The companion balance-reading is the absolute piecewise trend divided by the sum of absolute trend and noise, then scaled by 100 when that denominator is positive.
CTXS daily Q-indicator after 7/15 average reversals

Pane label is QIndicator(Close,7,15,4,250,2). Dates follow the February 2003–February 2004 month ticks. Readings are to the nearest half-unit; the raster does not support finer precision.
Screen after the series exist
Screening bands treat quality-reading magnitudes of 1, 2, and 5, and the matching negatives, as weak, moderate, and strong classes. They treat balance-reading values of 50, 65, and 80 as successively stronger trend-dominant states.
All readings on this track · 41 readings
- 1984Matching average age across price filters
- 1984Residual-impact construction of exponential smoothers
- 1988Constructing simple and exponential moving averages as specified filters
- 1989Evaluating smoothed free reserves and funds-discount spreads
- 1990Integer construction of moving averages and exponential smoothing
- 1990Constructing incremental moving average filters
- 1991Constructing a double-smoothed stochastic oscillator
- 1991Constructing an exponential average from a smoothing weight
- 1991Constructing a double-smoothed momentum oscillator family
- 1991Competing certainty rules from exponential-average conditions
- 1991Hybrid construction of a mechanical timing system from smoothed signals
- 1991Constructing an exponential smoother from a moving-average length
- 1991Equivalent relative-strength-index constructions from a ratio and from smoothed momentum
- 1991Constructing the true strength index from double-smoothed momentum
- 1991True strength index from signed, double-smoothed momentum
- 1992Constructing exponential averages from simple lookbacks
- 1992Constructing exponential averages by the smoothing constant, startup length and lag
- 1992Nested range smoothing and windowed high-low damping
- 1992A weekly equity stance from the discount-bill spread
- 1993Double-smoothed stochastics momentum index construction
- 1993Constructing the true strength index with double exponential smoothing
- 1994Polarized fractal efficiency with a shared exponential smoother
- 1994Five-interval exponential smoothing of ten-interval signed path-efficiency
- 1994Hand-ranked price-volume series with stacked smoothing and stochastic
- 1995Range expansion filter on multi-horizon averages
- 1995The exponential smoothing constant from averaging lag
- 1997Construct a nested-average rainbow band and oscillator
- 1998Filter stacks that combine a moving average with exponential smoothing
- 2002Smoothed relative-strength construction from wilder-averaging and a price prefilter
- 2003Reverse-engineered RSI price targets
- 2004Piecewise trend quality from moving-average reversals
- 2004Nested smoothing recipes versus unaudited oscillator experiments
- 2008Weight construction beyond the N-day label
- 2010A consensus filter for objective RSI and smoothing construction
- 2012Sentiment-zone oscillator from signed closes
- 2012Classic RSI one-over-N smoothing versus the standard exponential average
- 2013Why exponential smoothing uses two over n plus one
- 2015Constructing ratio indicators with moving-average and exponential-smoothing weights
- 2015Slow relative-strength index from an exponentially smoothed price
- 2017Rebuilding the relative strength index as open-scale buy-sell pressure
- 2017Comparing Wilder and exponential smoothing inside a relative-strength index