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

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明