//@version=5
indicator("Advanced Trading Strategy with Enhanced Features", overlay=true)
// --- سیگنالهای اولیه---
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
earlyBullSignal = ta.crossover(ema50, ema200)
earlyBearSignal = ta.crossunder(ema50, ema200)
// --- شا خصRSI ---
rsi14 = ta.rsi(close, 14)
// --- ت رک ی بMACD وRSI ---
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
combinedSignal = ta.crossover(macdLine, signalLine) and rsi14 > 50
// --- حجم معامالت---
avgVolume = ta.sma(volume, 50)
highVolume = volume > avgVolume
// --- حمایت و مقاومت---
support = ta.lowest(low, 20)
resistance = ta.highest(high, 20)
// --- فیلتر سیگنالها---
filteredBullSignal = earlyBullSignal and highVolume and close > support
filteredBearSignal = earlyBearSignal and highVolume and close < resistance
// --- Parabolic SAR ---
psar = ta.sar(0.02, 0.2)
trendUp = close > psar
trendDown = close < psar
confirmedBullSignal = filteredBullSignal and trendUp
confirmedBearSignal = filteredBearSignal and trendDown
// --- نمایش سیگنالها---
plotshape(confirmedBullSignal, style=shape.labelup, location=location.belowbar,
color=color.green, size=size.small, title="Buy")
plotshape(confirmedBearSignal, style=shape.labeldown, location=location.abovebar,
color=color.red, size=size.small, title="Sell")
// --- تعریف هشدارها---
alertcondition(confirmedBullSignal, title="Buy Signal", message="Buy Signal
Confirmed")
alertcondition(confirmedBearSignal, title="Sell Signal", message="Sell Signal
Confirmed")