OPEN-SOURCE SCRIPT

High Win Rate Trading Strategy Alerts

129
//version=5
indicator("High Win Rate Trading Strategy Alerts", overlay=true)

// Input settings
emaLength = input(20, title="EMA Length")
rsiLength = input(14, title="RSI Length")
fibLevel1 = input(0.382, title="Fib 38.2% Level")
fibLevel2 = input(0.5, title="Fib 50% Level")

// Indicators
ema20 = ta.ema(close, emaLength)
rsi = ta.rsi(close, rsiLength)

// Fibonacci Levels (Manual Plotting Needed)
highPrice = ta.highest(high, 50) // Adjust 50 for swing selection
lowPrice = ta.lowest(low, 50)
fib38 = highPrice - (highPrice - lowPrice) * fibLevel1
fib50 = highPrice - (highPrice - lowPrice) * fibLevel2

// Buy Setup Conditions
buySetup = (close > ema20) and (close <= fib50 and close >= fib38) and (rsi > 40) and (rsi < 70)

// Sell Setup Conditions
sellSetup = (close < ema20) and (close >= fib50 and close <= fib38) and (rsi < 60) and (rsi > 30)

// Alerts
alertcondition(buySetup, title="BUY Setup Alert", message="Buy Setup: Price at Fibonacci 38.2%-50%, EMA 20 confirmed, RSI strong.")
alertcondition(sellSetup, title="SELL Setup Alert", message="Sell Setup: Price at Fibonacci 38.2%-50%, EMA 20 confirmed, RSI weak.")

// Plot Signals on Chart
plotshape(buySetup, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY Alert")
plotshape(sellSetup, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL Alert")

plot(ema20, title="EMA 20", color=color.blue)

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.