OPEN-SOURCE SCRIPT
Custom RSI & Volume Condition

//version=5
indicator("Custom RSI & Volume Condition", overlay=true)
// دوال مساعدة
crossUp(src, level) =>
ta.crossover(src, level)
riseByPercent(src, percent, bars) =>
src > src[bars] * (1 + percent/100)
// حساب RSI
rsi = ta.rsi(close, 14)
// الشرط الأول: اختراق RSI لمستوى 45 أو 50
cond1 = crossUp(rsi, 45) or crossUp(rsi, 50)
// الشرط الثاني: RSI > 50 مع اختراق مستوى 55 أو 60
cond2 = (rsi > 50 and crossUp(rsi, 55)) or (rsi > 50 and crossUp(rsi, 60))
// الشرط الثالث: ارتفاع السعر بنسبة 2% مقارنة بالشمعة السابقة
cond3 = riseByPercent(close, 2, 1)
// الشرط الرابع: حجم التداول أكبر من حجم الشمعة السابقة
cond4 = volume > volume[1]
// التجميع النهائي
signal = (cond1 or cond2) and cond3 and cond4
// عرض إشارة على الرسم
plotshape(signal, title="Buy Signal", style=shape.labelup, color=color.green, text="BUY")
indicator("Custom RSI & Volume Condition", overlay=true)
// دوال مساعدة
crossUp(src, level) =>
ta.crossover(src, level)
riseByPercent(src, percent, bars) =>
src > src[bars] * (1 + percent/100)
// حساب RSI
rsi = ta.rsi(close, 14)
// الشرط الأول: اختراق RSI لمستوى 45 أو 50
cond1 = crossUp(rsi, 45) or crossUp(rsi, 50)
// الشرط الثاني: RSI > 50 مع اختراق مستوى 55 أو 60
cond2 = (rsi > 50 and crossUp(rsi, 55)) or (rsi > 50 and crossUp(rsi, 60))
// الشرط الثالث: ارتفاع السعر بنسبة 2% مقارنة بالشمعة السابقة
cond3 = riseByPercent(close, 2, 1)
// الشرط الرابع: حجم التداول أكبر من حجم الشمعة السابقة
cond4 = volume > volume[1]
// التجميع النهائي
signal = (cond1 or cond2) and cond3 and cond4
// عرض إشارة على الرسم
plotshape(signal, title="Buy Signal", style=shape.labelup, color=color.green, text="BUY")
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
وتستمر الحياة
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
وتستمر الحياة
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.