15srsi
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © therockmangotem

//@version=5
indicator(title = "15srsi", timeframe="15", timeframe_gaps=true, precision=0) 

smoothK = 3
smoothD = 3
lengthRSI = 14
lengthStoch = 14
src1 = close
src2 = close[1]
rsi1 = ta.rsi(src1, lengthRSI)
rsi2 = ta.rsi(src2, lengthRSI)
k1 = ta.sma(ta.stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d1 = ta.sma(k1, smoothD)
k2 = ta.sma(ta.stoch(rsi2, rsi2, rsi2, lengthStoch), smoothK)
d2 = ta.sma(k2, smoothD)
hi = 90
lo = 10

i15srsi = 0

if k1 >= hi
    if d1 >= hi
        if k2 >= hi
            if d2 >= hi
                i15srsi := 1
else if k1 <= lo
    if d1 <= lo
        if k2 <= lo
            if d2 <= lo
                i15srsi := -1
else
    i15srsi := 0

plot(i15srsi, "15srsi", color=#FF8000)



