I understand buy stop appears when the price is above the current market price.
I need to understand why does the Buy stop order appear here. I don't quite understand how does RSI Signal Indicator affects the buy stop ?
This is the code
//if above 70 , overbought , if below 30, then oversold
strategy(title="Stop Order RSI Strategy", shorttitle="Stop Order RSI", format=format.price, precision=2)
//Inputs
i_oversold = input(30 , title="Oversold")
i_overbought = input(70 , title="Overbought")
len = input(14, minval=1, title="Length")
src = input(close, "Source", type = input.source)
//Calculations
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
//Plotting
plot(rsi, "RSI", color=#8E1599)
band1 = hline(70, "Upper Band", color=#C0C0C0)
band0 = hline(30, "Lower Band", color=#C0C0C0)
fill(band1, band0, color=#9915FF, transp=90, title="Background")
goLong = rsi < i_oversold
goShort = rsi > i_overbought
strategy.entry("Buy Stop" , stop=high , when = goLong , long = true)
strategy.entry("Sell Stop" , stop=low , when = goShort , long = strategy.short)
Appreciate if someone can take their time to explain what is going on here because I am very lost.

