OPEN-SOURCE SCRIPT

Scalping Strategy - 70% Accuracy

//version=5
indicator("Scalping Strategy - 70% Accuracy", overlay=true)

// Input for moving averages and RSI
shortEMA = input.int(50, title="Short Period EMA", minval=1)
longEMA = input.int(200, title="Long Period EMA", minval=1)
rsiPeriod = input.int(14, title="RSI Period", minval=1)
rsiOverbought = input.int(70, title="RSI Overbought", minval=1)
rsiOversold = input.int(30, title="RSI Oversold", minval=1)

// Calculate exponential moving averages
shortEMAValue = ta.ema(close, shortEMA)
longEMAValue = ta.ema(close, longEMA)

// Calculate RSI
rsiValue = ta.rsi(close, rsiPeriod)

// Define buy and sell conditions
buyCondition = ta.crossover(shortEMAValue, longEMAValue) and rsiValue < rsiOversold
sellCondition = ta.crossunder(shortEMAValue, longEMAValue) and rsiValue > rsiOverbought

// Plot buy and sell signals
plotshape(buyCondition, color=color.green, style=shape.labelup, location=location.belowbar, text="BUY")
plotshape(sellCondition, color=color.red, style=shape.labeldown, location=location.abovebar, text="SELL")

// Plot exponential moving averages
plot(shortEMAValue, color=color.blue, linewidth=2, title="50-period EMA")
plot(longEMAValue, color=color.orange, linewidth=2, title="200-period EMA")

// Add RSI to the chart
plot(rsiValue, color=color.purple, title="RSI", linewidth=2, offset=-20)
hline(rsiOverbought, "Overbought", color=color.red)
hline(rsiOversold, "Oversold", color=color.green)
Bands and Channels

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明