The Bounded Slope Indicator
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Sofien-Kaabar

//@version=5
indicator("Slope")

lookback     = input(defval = 14, title = 'Lookback')
lookback_rsi = input(defval = 14, title = 'RSI Lookback')

slope      = (close - close[lookback]) / lookback
indicator  = ta.rsi(slope, lookback_rsi)

plot(indicator, color = indicator > 50? color.blue : color.red)
hline(70)
hline(30)
hline(50)