OPEN-SOURCE SCRIPT

Meta5 Scalping Indicator

//version=5
indicator("Meta5 Scalping Indicator", shorttitle="MSI", overlay=true)

// Inputs for Moving Averages
fastLength = input.int(9, title="Fast EMA Length")
slowLength = input.int(21, title="Slow EMA Length")

// Inputs for RSI
rsiLength = input.int(14, title="RSI Length")
rsiOverbought = input.int(70, title="RSI Overbought Level")
rsiOversold = input.int(30, title="RSI Oversold Level")

// Inputs for Scalping Conditions
atrLength = input.int(14, title="ATR Length")
atrMultiplier = input.float(1.5, title="ATR Multiplier")

// Calculations
fastEMA = ta.ema(close, fastLength)
slowEMA = ta.ema(close, slowLength)
rsi = ta.rsi(close, rsiLength)
atr = ta.atr(atrLength)

// Conditions for Buy and Sell Signals
bullishCondition = ta.crossover(fastEMA, slowEMA) and rsi < rsiOversold
bearishCondition = ta.crossunder(fastEMA, slowEMA) and rsi > rsiOverbought

// Stop Loss and Take Profit Levels
longStopLoss = close - (atr * atrMultiplier)
shortStopLoss = close + (atr * atrMultiplier)

// Plot Buy and Sell Signals
plotshape(bullishCondition, title="Buy Signal", style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0))
plotshape(bearishCondition, title="Sell Signal", style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0))

// Plot EMAs
plot(fastEMA, title="Fast EMA", color=color.blue)
plot(slowEMA, title="Slow EMA", color=color.orange)

// Background Color for Overbought and Oversold RSI
bgcolor(rsi > rsiOverbought ? color.new(color.red, 90) : rsi < rsiOversold ? color.new(color.green, 90) : na)
Breadth IndicatorsTrend AnalysisWave Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer