//@version=5 indicator("Ultimate Buy & Sell Scalper", overlay=tr

//@version=5 indicator("Ultimate Buy & Sell Scalper", overlay=tr

//@version=5
indicator("Ultimate Buy & Sell Scalper", overlay=true)

// Input parameters
atrLength = input(14, title="ATR Length")
atrMult = input(2.5, title="ATR Multiplier")
rsiLength = input(14, title="RSI Length")
maLength = input(50, title="Moving Average Length")

// ATR-Based SuperTrend Calculation
atrValue = ta.atr(atrLength)
basicUpperBand = ta.sma(close, atrLength) + (atrMult * atrValue)
basicLowerBand = ta.sma(close, atrLength) - (atrMult * atrValue)
superTrend = close > basicUpperBand ? basicLowerBand : basicUpperBand

// RSI Calculation
rsi = ta.rsi(close, rsiLength)

// Moving Average
ma = ta.sma(close, maLength)

// Buy & Sell Logic
buySignal = ta.crossover(close, superTrend) and rsi < 35 and close > ma
sellSignal = ta.crossunder(close, superTrend) and rsi > 65 and close < ma

// Plot Buy & Sell Arrows
plotshape(buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY")
plotshape(sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL")

// Plot SuperTrend Line
plot(superTrend, title="SuperTrend Line", color=color.blue, linewidth=2)

Read More

Share:

Latest News