RecursiveMedianOscillator
Oscillator derived from the Recursive Median filter using a 2nd-order Highpass filter.
Usage
Identify cyclic turning points with reduced lag and noise. The high-pass component removes the trend, leaving the cycle.
Background
By applying a 2nd-order Highpass filter to the Recursive Median output, we create an oscillator that is specifically tuned to the dominant cycle while remaining immune to the outlier spikes that would otherwise create false signals.
Parameters
lp_period(default: 12): Low-pass smoothing periodhp_period(default: 30): High-pass cutoff period
Formula
[ \alpha_2 = \frac{\cos(0.707 \cdot 360/HP) + \sin(0.707 \cdot 360/HP) - 1}{\cos(0.707 \cdot 360/HP)} ] [ RMO_t = (1-\alpha_2/2)^2(RM_t - 2RM_{t-1} + RM_{t-2}) + 2(1-\alpha_2)RMO_{t-1} - (1-\alpha_2)^2RMO_{t-2} ]