OPEN-SOURCE SCRIPT

Abu Basel IQOption 2m Signals

31
//version=5
indicator("Abu Basel IQOption 2m Signals", overlay = true, timeframe = "", timeframe_gaps = true)

//========================
// الإعدادات
//========================
emaFastLen = input.int(9, "EMA سريع (9)")
emaSlowLen = input.int(21, "EMA بطيء (21)")
rsiLen = input.int(14, "RSI Length", minval = 2)
rsiBuyLevel = input.float(50.0, "RSI حد الشراء (أعلى من)", minval = 0, maxval = 100)
rsiSellLevel= input.float(50.0, "RSI حد البيع (أقل من)", minval = 0, maxval = 100)

bbLen = input.int(20, "Bollinger Length")
bbMult = input.float(2.0, "Bollinger Deviation")

showSignals = input.bool(true, "إظهار الأسهم (CALL / PUT)")
showBg = input.bool(true, "تلوين الخلفية عند الإشارات")

//========================
// المؤشرات الأساسية
//========================
emaFast = ta.ema(close, emaFastLen)
emaSlow = ta.ema(close, emaSlowLen)

basis = ta.sma(close, bbLen)
dev = bbMult * ta.stdev(close, bbLen)
bbUpper = basis + dev
bbLower = basis - dev

rsi = ta.rsi(close, rsiLen)

// رسم المتوسطات والبولينجر
plot(emaFast, title = "EMA 9", linewidth = 2)
plot(emaSlow, title = "EMA 21", linewidth = 2)

plot(basis, title = "BB Basis", linewidth = 1)
plot(bbUpper, title = "BB Upper", linewidth = 1, style = plot.style_line)
plot(bbLower, title = "BB Lower", linewidth = 1, style = plot.style_line)

//========================
// دوال أشكال الشموع الانعكاسية
//========================
bodySize = math.abs(close - open)
fullRange = high - low
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low

isSmallBody = bodySize <= fullRange * 0.3

// Hammer صاعدة (ذيل سفلي طويل)
bullHammer() =>
lowerWick > bodySize * 2 and upperWick <= bodySize and close > open

// Shooting Star هابطة (ذيل علوي طويل)
bearShootingStar() =>
upperWick > bodySize * 2 and lowerWick <= bodySize and close < open

// Bullish Engulfing
bullEngulfing() =>
close > open and close[1] < open[1] and close > open[1] and open < close[1]

// Bearish Engulfing
bearEngulfing() =>
close < open and close[1] > open[1] and close < open[1] and open > close[1]

// تجميع أنماط صعود/هبوط
bullPattern = bullHammer() or bullEngulfing()
bearPattern = bearShootingStar() or bearEngulfing()

//========================
// شروط الدخول
//========================

// تقاطع المتوسطات
bullCross = ta.crossover(emaFast, emaSlow) // صعود
bearCross = ta.crossunder(emaFast, emaSlow) // هبوط

// شروط شراء CALL:
// 1) تقاطع EMA9 فوق EMA21
// 2) السعر فوق خط وسط البولنجر
// 3) RSI أعلى من 50
// 4) شمعة انعكاسية صاعدة (Hammer أو Engulfing)
callCond = bullCross and close > basis and rsi > rsiBuyLevel and bullPattern

// شروط بيع PUT:
// 1) تقاطع EMA9 تحت EMA21
// 2) السعر تحت خط وسط البولنجر
// 3) RSI أقل من 50
// 4) شمعة انعكاسية هابطة (Shooting Star أو Bearish Engulfing)
putCond = bearCross and close < basis and rsi < rsiSellLevel and bearPattern

//========================
// رسم الإشارات على الشارت
//========================
plotshape(showSignals and callCond, title="CALL 2m",
style=shape.labelup, location=location.belowbar,
text="CALL\n2m", size=size.tiny)

plotshape(showSignals and putCond, title="PUT 2m",
style=shape.labeldown, location=location.abovebar,
text="PUT\n2m", size=size.tiny)

// تلوين الخلفية عند الإشارات
bgcolor(showBg and callCond ? color.new(color.green, 85) :
showBg and putCond ? color.new(color.red, 85) : na)

//========================
// شروط التنبيه (Alerts)
//========================
alertcondition(callCond, title="CALL 2m Signal",
message="Abu Basel Signal: CALL 2m on {{ticker}} at {{close}}")

alertcondition(putCond, title="PUT 2m Signal",
message="Abu Basel Signal: PUT 2m on {{ticker}} at {{close}}")

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.