Accelerating RSRS Timing Calculations with Vectorized Rolling Regression
Summary
The article explains how to calculate the Resistance Support Relative Strength (RSRS) market-timing indicator more quickly. RSRS fits a rolling regression of highs against lows; its slope is used as a measure of the relationship between resistance and support. The article also describes standardizing the slope over a longer rolling window and applying a right-skew adjustment that incorporates the regression fit statistic.
The proposed optimization replaces repeated per-window regression calls with batched NumPy matrix operations over rolling windows. For one reported dataset and parameter setup, the author compares the accelerated calculation with the original implementation and reports matching output, alongside a large reduction in runtime. The timing depends on the machine and the tested data, and the article notes that parallel processing or distributed computing may be needed for large universes. It also reports that the adjusted RSRS timing strategy had substantial drawdown in recent years, so faster computation does not establish trading effectiveness.
Key ideas
- RSRS uses rolling regression of highs against lows, with the slope serving as a timing measure.
- The article calculates a standardized slope and describes an adjustment using the regression fit statistic.
- Batched NumPy matrix operations can replace repeated rolling regression calls.
- The author reports matching outputs and substantially lower runtime for the tested setup.
- Runtime depends on hardware and scale, while reported recent drawdown cautions against equating speed with strategy quality.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.