OPEN-SOURCE SCRIPT
EMRVA

//version=5
indicator("EMRVA", overlay=true)
// === الإعدادات ===
emaLength = input.int(200, "EMA Length")
rsiLength = input.int(14, "RSI Length")
volLength = input.int(20, "Volume MA Length")
adxLength = input.int(14, "ADX Length")
adxFilter = input.int(20, "ADX Minimum Value") // فلتر الاتجاه
// === EMA200 ===
ema200 = ta.ema(close, emaLength)
plot(ema200, color=color.orange, linewidth=2, title="EMA 200")
// === MACD ===
macdLine = ta.ema(close, 12) - ta.ema(close, 26)
signalLine = ta.ema(macdLine, 9)
// === RSI ===
rsi = ta.rsi(close, rsiLength)
// === Volume Confirmation ===
volMA = ta.sma(volume, volLength)
volCond = volume > volMA
// === ADX Manual Calculation ===
upMove = high - high[1]
downMove = low[1] - low
plusDM = na(upMove) ? na : (upMove > downMove and upMove > 0 ? upMove : 0)
minusDM = na(downMove) ? na : (downMove > upMove and downMove > 0 ? downMove : 0)
tr = ta.rma(ta.tr, adxLength)
plusDI = 100 * ta.rma(plusDM, adxLength) / tr
minusDI = 100 * ta.rma(minusDM, adxLength) / tr
dx = 100 * math.abs(plusDI - minusDI) / (plusDI + minusDI)
adx = ta.rma(dx, adxLength)
adxCond = adx > adxFilter
// === شروط الدخول والخروج ===
longCond = close > ema200 and macdLine > signalLine and rsi > 50 and volCond and adxCond
shortCond = close < ema200 and macdLine < signalLine and rsi < 50 and volCond and adxCond
// === منطق الإشارة عند بداية الاتجاه فقط ===
var inLong = false
var inShort = false
buySignal = longCond and not inLong
sellSignal = shortCond and not inShort
if buySignal
inLong := true
inShort := false
if sellSignal
inShort := true
inLong := false
// === إشارات ثابتة ===
plotshape(buySignal, title="Buy Signal", location=location.belowbar,
color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="Sell Signal", location=location.abovebar,
color=color.red, style=shape.labeldown, text="SELL")
// === تنبيهات ===
alertcondition(buySignal, title="Buy Alert", message="📈 إشارة شراء مؤكدة مع فلتر ADX")
alertcondition(sellSignal, title="Sell Alert", message="📉 إشارة بيع مؤكدة مع فلتر ADX")
// === رسم ADX للتأكيد ===
plot(adx, title="ADX", color=color.blue)
hline(adxFilter, "ADX Filter", color=color.red)
indicator("EMRVA", overlay=true)
// === الإعدادات ===
emaLength = input.int(200, "EMA Length")
rsiLength = input.int(14, "RSI Length")
volLength = input.int(20, "Volume MA Length")
adxLength = input.int(14, "ADX Length")
adxFilter = input.int(20, "ADX Minimum Value") // فلتر الاتجاه
// === EMA200 ===
ema200 = ta.ema(close, emaLength)
plot(ema200, color=color.orange, linewidth=2, title="EMA 200")
// === MACD ===
macdLine = ta.ema(close, 12) - ta.ema(close, 26)
signalLine = ta.ema(macdLine, 9)
// === RSI ===
rsi = ta.rsi(close, rsiLength)
// === Volume Confirmation ===
volMA = ta.sma(volume, volLength)
volCond = volume > volMA
// === ADX Manual Calculation ===
upMove = high - high[1]
downMove = low[1] - low
plusDM = na(upMove) ? na : (upMove > downMove and upMove > 0 ? upMove : 0)
minusDM = na(downMove) ? na : (downMove > upMove and downMove > 0 ? downMove : 0)
tr = ta.rma(ta.tr, adxLength)
plusDI = 100 * ta.rma(plusDM, adxLength) / tr
minusDI = 100 * ta.rma(minusDM, adxLength) / tr
dx = 100 * math.abs(plusDI - minusDI) / (plusDI + minusDI)
adx = ta.rma(dx, adxLength)
adxCond = adx > adxFilter
// === شروط الدخول والخروج ===
longCond = close > ema200 and macdLine > signalLine and rsi > 50 and volCond and adxCond
shortCond = close < ema200 and macdLine < signalLine and rsi < 50 and volCond and adxCond
// === منطق الإشارة عند بداية الاتجاه فقط ===
var inLong = false
var inShort = false
buySignal = longCond and not inLong
sellSignal = shortCond and not inShort
if buySignal
inLong := true
inShort := false
if sellSignal
inShort := true
inLong := false
// === إشارات ثابتة ===
plotshape(buySignal, title="Buy Signal", location=location.belowbar,
color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="Sell Signal", location=location.abovebar,
color=color.red, style=shape.labeldown, text="SELL")
// === تنبيهات ===
alertcondition(buySignal, title="Buy Alert", message="📈 إشارة شراء مؤكدة مع فلتر ADX")
alertcondition(sellSignal, title="Sell Alert", message="📉 إشارة بيع مؤكدة مع فلتر ADX")
// === رسم ADX للتأكيد ===
plot(adx, title="ADX", color=color.blue)
hline(adxFilter, "ADX Filter", color=color.red)
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.
Skrypt open-source
W duchu TradingView twórca tego skryptu udostępnił go jako open-source, aby traderzy mogli analizować i weryfikować jego funkcjonalność. Brawo dla autora! Możesz korzystać z niego za darmo, ale pamiętaj, że ponowna publikacja kodu podlega naszym Zasadom Społeczności.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.