RSBB
//@version=2 strategy("RSI_BB", overlay=true) length = input( 30 ) overSold = input( 40 ) overBought = input( 60) price = (high + low + close) / 3 source = (high + low + close) / 3 lengtha = input(50, minval=1) mult = input(0.2, minval=0.001, maxval=50) basis = sma(source, lengtha) dev = mult * stdev(source, lengtha) upper = basis + dev lower = basis - dev buyEntry = crossover(source, lower) sellEntry = crossunder(source, upper) vrsi = rsi(price, length) if (not na(vrsi)) if (source > upper)and(vrsi < 40) strategy.entry("RsiLE", strategy.long, comment="Buy") if (source < lower)and(vrsi > 60) strategy.entry("RsiSE", strategy.short, comment="Sell") //plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)