Shizaru

RSI Divergence

RSI DIVERGENCE is a difference between a fast and a slow RSI . Default values are 5 for the fast one and 14 for the slow one.
You can use this indicator in 2 different ways:
  • normal RSI: check double or triple top/bottom on a chart meanwhile RSI is descending/ascending (check the example on chart)
  • signal line: when RSI Divergence cross zero line from bottom to top you get a buy signal (the line become green), vice versa when the RSI Divergence cross zero line in the opposite way you get a sell signal (the line become red)
إزالة من البرامج النصية المفضلة أضف إلى البرامج النصية المفضلة

التحليلات ذات الصلة

التعليقات

@Shizaru thanks for the nice code. Looks really great.
Is it possible that the script also draws the dotted line as in your example on two or three top / bottom ?

+35 رد
This looks amazing. I'm just wondering how to set the alert so that it triggers when the signal line changes colors (red to green/green to red). Does anyone have any experience setting this? Thanks!
+27 رد
AgeM jregan11
@jregan11, Did you solve this?
+7 رد
AgeM AgeM
+6 رد
@AgeM, @jregan11 If you need a hand with this let me know. I'm happy to code something. Just PM me.
+4 رد
self2point0 jregan11
@jregan11, add this to the bottom of the script

divlong = divergence < 0 and divergence >=0
divshort = divergence > 0 and divergence <=0

alertcondition(divlong, title='Div Long', message='Div Long')
alertcondition(divshort, title='Div Short', message='Div Short')

data1 = divlong
plotshape(data1, style=shape.triangleup,location=location.bottom, color=green , title="DivUp")

data2 = divshort
plotshape(data2, style=shape.triangledown, location=location.top, color=red,title="DivDown")
+4 رد
Minimal_Est self2point0
@self2point0, hi does it actually work ?
رد
self2point0 Minimal_Est
@Minimal_Est, yes definitely works. Here's the full script:

study(title="RSI Divergence w Alerts", shorttitle="RSI Divergence w alerts")
src_fast = close, len_fast = input(10, minval=1, title="Length Fast RSI")
src_slow = close, len_slow = input(33,minval=1, title="Length Slow RSI")
up_fast = rma(max(change(src_fast), 0), len_fast)
down_fast = rma(-min(change(src_fast), 0), len_fast)
rsi_fast = down_fast == 0 ? 100 : up_fast == 0 ? 0 : 100 - (100 / (1 + up_fast / down_fast))
up_slow = rma(max(change(src_slow), 0), len_slow)
down_slow = rma(-min(change(src_slow), 0), len_slow)
rsi_slow = down_slow == 0 ? 100 : up_slow == 0 ? 0 : 100 - (100 / (1 + up_slow / down_slow))
//plotfast = plot(rsi_fast, color=blue)
//plotslow = plot(rsi_slow, color=orange)
divergence = rsi_fast - rsi_slow
plotdiv = plot(divergence, color = divergence > 0 ? green:red, linewidth = 3)
//band1 = hline(70,color=green)
//band0 = hline(30,color=red)
band = hline(0)

divlong = divergence < 0 and divergence >=0
divshort = divergence > 0 and divergence <=0

alertcondition(divlong, title='Div Long', message='Div Long')
alertcondition(divshort, title='Div Short', message='Div Short')

data1 = divlong
plotshape(data1, style=shape.triangleup,location=location.bottom, color=green , title="DivUp")

data2 = divshort
plotshape(data2, style=shape.triangledown, location=location.top, color=red,title="DivDown")
رد
Very good oscillator. Just one question. Why the line color change of (green/red) after or before crossing zero line ?

I compared with two RSI (14/5) I think it's the moment when the RSI 5 and RSI 14 cross...
+9 رد
الصفحة الرئيسية منصة الأسهم منصًة العملات منصّة العملات الرقمية جدول الأعمال الاقتصادي كيف تعمل مميزات الرسم البياني أسعار العضوية إحالة صديق قوانين الموقع مركز المساعدة حلول المواقع الإلكترونية والوسطاء الأدوات حلول الرسوم البيانية مكتبة الرسوم البيانية صغيرة الحجم المدوّنة والأخبار تويتر
ملف التعريف إعدادات الصفحة الشخصية الحساب وإعداد الفواتير إحالة صديق تذاكر الدعم الخاصة بي مركز المساعدة التحاليل المنشورة المتابعين تُتابع رسالة خاصة المحادثة تسجيل الخروج