2002issue C101-4
Constructing the relative strength index with an even-order finite-impulse-response prefilter
The relative strength index is the upward share of close-to-close change over a fixed observation window. A short even-order finite-impulse-response moving average belongs on those signed changes before the ratio, so both legs stay synchronized while the shortest cycles are removed.
- The relative strength index equals 100 times the sum of upward close-to-close changes divided by the sum of all close-to-close changes over the observation window, and it can reach 100 and 0 when that window is half a pure sinewave cycle.
- Smoothing close-to-close differences before the ratio keeps the same lag in the numerator and the denominator and is mathematically identical to smoothing the combined up-plus-down sum.
- A four-bar symmetrically weighted finite-impulse-response filter with coefficients 1, 2, 2, and 1, scaled by 6, suppresses two-bar and three-bar cycles at 1.5 bars of lag, and that lag is treated as more important than the extra smoothing of a six-bar window.
- When the finite-impulse-response prefilter is applied before the ratio, the finished oscillator is smoother than the unfiltered relative strength index and shows more distinct turning points than a relative strength index filtered only after it is computed.
The relative strength index is a bounded oscillator formed as the share of upward close-to-close changes in the total of upward and downward close-to-close changes over a fixed lookback. The construction below applies a short finite-impulse-response moving average before those increments enter the ratio.
How the relative strength index is formed
The relative strength index equals 100 times the sum of upward close-to-close changes divided by the sum of all close-to-close changes over the chosen observation window. If the observation window is half the length of a pure sinewave cycle, the oscillator reaches 100 on the rising half-cycle and 0 on the falling half-cycle.
Why the prefilter sits before the ratio
Smoothing close-to-close differences before the relative-strength-index ratio keeps the same lag in the numerator and the denominator. That prefilter is mathematically identical to smoothing the combined up-plus-down sum. Prefilter placement is the choice to apply the finite-impulse-response moving average to close differences before, rather than after, the ratio.
Uniform lag versus frequency-dependent lag
An exponential moving average, as an infinite-impulse-response smoother, applies different lag to different frequencies. A finite-impulse-response moving average of length N applies a uniform lag of (N minus 1) divided by 2. The moving averages used here are simple and symmetrically weighted windows, which are the finite-impulse-response cases in this construction.
Even-order windows and the shortest cycles
A two-bar simple moving average removes the two-bar cycle. A three-bar simple moving average removes the three-bar cycle while leaving residual two-bar energy. The two-bar cycle is the Nyquist frequency, the highest representable frequency at two samples per cycle; cycle length equals 2 divided by normalized frequency. Two-bar cycles are suppressed only when the filter order is even.
A four-bar symmetrically weighted finite-impulse-response filter with coefficients 1, 2, 2, and 1, scaled by 6, suppresses both two-bar and three-bar cycles at 1.5 bars of lag. A six-bar symmetrically weighted finite-impulse-response filter with coefficients 1, 2, 3, 3, 2, and 1, scaled by 12, suppresses two-, three-, and four-bar cycles at 2.5 bars of lag. The construction favors the four-bar filter because 1.5 bars of lag is treated as more important than extra smoothing.
A worked four-bar construction
The worked construction first forms a four-bar weighted average of closes, then over a lookback illustrated as 10 bars accumulates upward and downward increments of that smoothed series. It outputs the upward share of the total increment when the total is nonzero.
What changes in the finished oscillator
When the finite-impulse-response prefilter is applied before the ratio, the finished oscillator is smoother than the unfiltered relative strength index and shows more distinct turning points than a relative strength index that is filtered only after it is computed.
All readings on this track · 10 readings
- 1982An odd-length smoother from a cycle cutoff
- 1989Smoothing filters, cutoff, poles, and sample delay
- 1992Constructing a cycle-aware finite impulse response detrender
- 2002Rebuild a smoother by writing the lag into the coefficients
- 2002Timing market cycles with finite impulse response filters and FFT
- 2002Constructing the relative strength index with an even-order finite-impulse-response prefilter
- 2003Recursive and cascaded moving-average construction
- 2006One second-order transfer function, a family of trend filters
- 2019Constructing the Voss line from a bandpass and a short FIR sum
- 2020Truncated bandpass construction as a finite-length trend filter