Double RSI 00 1.0
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © egghen

//@version=5
indicator('Double RSI 00 1.0')

// Inputs
length_1 = input(7, title='RSI1 Length')
length_2 = input(12, title='RSI2 Length')
overbought_1 = input(75, title='Overbought Signal')
oversold_1 = input(25, title='Oversold Signal ')
overbought_2 = input(85, title='High Overbought Signal')
oversold_2 = input(15, title='High Oversold Signal')

// RSI Calculation
rsi_1 = ta.rsi(hl2, length_1)
rsi_2 = ta.rsi(hl2, length_2)

// Plot Setting
plot(rsi_1, color=color.new(#1fed14, 0), linewidth=2, title='RSI1')
plot(rsi_2, color=color.new(#cfd648, 37), title='RSI2')
h0 = hline(0, 'Lower Band', color=#787B86)
h1 = hline(50, 'Middle Band', color=#f2f3f5cb)
h2 = hline(100, 'Upper Band', color=#787B86)
h3 = hline(oversold_1, 'Oversold', color=#26f806a1)
h4 = hline(overbought_1, 'Overbought', color=#f50e06a1)
h5 = hline(oversold_2, 'High Oversold', color=#787B86)
h6 = hline(overbought_2, 'High Overbought', color=#787B86)

// Define Alerts
overbought = ta.crossunder(rsi_1, overbought_1)
oversold = ta.crossover(rsi_1, oversold_1)
high_overbought = ta.crossunder(rsi_1, overbought_2)
high_oversold = ta.crossover(rsi_1, oversold_2)
long_alert = ta.crossover(rsi_1, rsi_2)
short_alert = ta.crossunder(rsi_1, rsi_2)

// Send an alert
if long_alert
    alert('DoubleRSI OO 1.0 - Long Signal.')
if short_alert
    alert('DoubleRSI OO 1.0 - Short Signal.')
if overbought
    alert('DoubleRSI OO 1.0 - Overbought Signal.')
if oversold
    alert('DoubleRSI OO 1.0 - Oversold Signal.')
if high_overbought
    alert('DoubleRSI OO 1.0 - High Overbought Signal.')
if high_oversold
    alert('DoubleRSI OO 1.0 - High Oversold Signal.')
//

// end code