OPEN-SOURCE SCRIPT

Scalping Strategy

139
//version=5
strategy("Scalping Strategy", overlay=true)

// Indicators
ma50 = ta.sma(close, 50)
ema20 = ta.ema(close, 20)
ema200 = ta.ema(close, 200)
rsi = ta.rsi(close, 14)
osc = ta.stoch(close, high, low, 14)
vol = volume

// Trend Confirmation
bullishTrend = ema20 > ema200 and close > ma50
bearishTrend = ema20 < ema200 and close < ma50

// RSI Divergence Detection
rsiOverbought = rsi > 70
rsiOversold = rsi < 30

// Oscillator Confirmation
oscBull = osc < 20
oscBear = osc > 80

// Volume Confirmation
highVolume = vol > ta.sma(vol, 20)

// Entry Conditions
buySignal = bullishTrend and rsiOversold and oscBull and highVolume
sellSignal = bearishTrend and rsiOverbought and oscBear and highVolume

// Execute Trades
if buySignal
strategy.entry("Buy", strategy.long)
if sellSignal
strategy.entry("Sell", strategy.short)

// Plot indicators
plot(ma50, color=color.blue, title="MA 50")
plot(ema20, color=color.green, title="EMA 20")
plot(ema200, color=color.red, title="EMA 200")

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.