Scalping Strategy (5min)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © AySiam
//@version=5
indicator("Scalping Strategy (5min)", overlay=true)

usesma = input(true , "Slow MA")
usesmafilter= input(true , "Fast MA")
rsi1Length = input(28, "Slow RSI Length")
rsi2Length = input(7, "Fast RSI Length")
simplema = input(200, "Slow MA")
simplema2 = input(5, "Fast MA")

sma1= ta.sma(close, simplema)
sma2= ta.sma(close, simplema2)
src = input.source(close, "Source (This Affects Signals)")
smafilterbuy= (src  > sma2)
smafiltersell= (src  < sma2)
rsi14Value = ta.rsi(close, rsi1Length)
rsi2Value = ta.rsi(close, rsi2Length)
smaValue = ta.sma(close, simplema)

//Bollinger Bands
[bbUpper, bbMiddle, bbLower] = ta.bb(close, 20, 2)
//Buy/Sell
enterLong = (not usesmafilter or smafilterbuy) and  (not usesma or (open > smaValue)) and ta.crossover(rsi2Value, rsi14Value)
enterShort = (not usesmafilter or smafiltersell) and (not usesma or (open < smaValue)) and ta.crossunder(rsi2Value, rsi14Value)

plotshape(enterLong, title="Buy", location=location.belowbar, color=color.green, style=shape.square, text="Buy",textcolor= color.green)
plotshape(enterShort, title="Sell", location=location.abovebar, color=color.red, style=shape.square, text= "Sell", textcolor= color.red)
plot(bbMiddle, color=color.blue , title="BB Upper")
plot(bbUpper, color=color.orange, title="BB Middle")
plot(bbLower, color=color.blue, title="BB Lower")
plot(sma1, color=color.white, title = "Slow MA")
plot(sma2, color=color.yellow , title = "Fast MA")