OPEN-SOURCE SCRIPT

Sag Macd

The main change in this code is the src variable. Instead of using an input for the source, it now calculates the 14-period RSI of the close price:
text
src = ta.rsi(close, 14)
This modification means that the MACD indicator will now be based on the RSI values rather than the original price data. The RSI is calculated using the default period of 14, which is a commonly used setting.
The rest of the code remains the same, applying the MACD calculations to the RSI values. This will result in a MACD indicator that reflects the momentum of the RSI rather than the price directly, potentially providing different insights into the market dynamics
Cycles

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer