Skip to content
All library documents

Dynamic RSI Length Based on Price–Momentum Correlation

Article TradingView scripts

Summary

This strategy adapts the RSI lookback length using the correlation between price and its momentum. It calculates momentum as the difference between the current source price and its value several bars earlier, then maps the correlation into a user-defined minimum and maximum RSI length. A correlation near positive one selects the shorter length, while a value near negative one selects the longer length.

The strategy enters long when the dynamic RSI crosses up through the oversold threshold and short when it crosses down through the overbought threshold. The script exposes the momentum lookback, RSI length bounds, and threshold levels, and sizes orders as a percentage of equity. The author describes the idea as an attempt to reduce reliance on fixed parameters, but reports that deep backtesting performance was not strong and suggests regime filters may be needed. No market, timeframe, transaction cost assumptions, or quantitative performance results are provided, so the script alone does not establish whether the approach is robust or tradable.

Key ideas

  • The RSI lookback is mapped dynamically from the correlation between price and its momentum.
  • Positive correlation selects a shorter RSI length, while negative correlation selects a longer one.
  • Long entries occur when the dynamic RSI crosses above the oversold threshold.
  • Short entries occur when the dynamic RSI crosses below the overbought threshold.
  • The author reports weak deep backtesting performance and identifies regime filtering as a possible improvement.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.