Hi Everyone,
I have just moved from using Tradingview to Prorealtime. Looking for help in converting one of the indicators I used there. Unfortunately, dont have the xperience to convert myself.
Is there a way somebody can help?
study(title=”RSI Divergence”, shorttitle=”RSI Divergence”)
src_fast = close, len_fast = input(5, minval=1, title=”Length Fast RSI”)
src_slow = close, len_slow = input(14,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 ? lime:red, linewidth = 2)
//band1 = hline(70,color=green)
//band0 = hline(30,color=red)
band = hline(0)
Thanks
Ritesh
Hi Ritesh Nayak , Maybe it’s something like this :
REM RSI DIVERGENCE
//on platform Traidngview by Shizaru
//adapted for platfomr Prorealtime v 10.3 by bolsatrilera
srcfast = close
lenfast = 5 //minval=1, title="Length Fast RSI")
srcslow = close
lenslow = 14 //minval=1, title="Length Slow RSI")
upfast =WilderAverage[lenfast](max(close-close[1],srcfast))
downfast =WilderAverage[lenfast](min(close-close[1],srcfast))
if downfast = 0 then
rsifast =100
elsif upfast =0 then
rsifast = 0
else
rsifast =100 - (100 / (1 + upfast / downfast))
endif
upslow =WilderAverage[lenslow](max(close-close[1],srcslow))
downslow =WilderAverage[lenslow](min(close-close[1],srcslow))
if downslow = 0 then
rsislow =100
elsif upslow =0 then
rsislow=0
else
rsislow =100 - (100 / (1 + upslow / downslow))
endif
divergence = rsifast - rsislow
if divergence > 0 then
r=0
g=255
b=0
else
r=255
g=0
b=0
endif
return divergence coloured (r,g,b)as "rsi divergence", 0 style(dottedline)as "0"
allow me a small correction, now if I give it for good :
REM RSI DIVERGENCE
//on platform Traidngview by Shizaru
//adapted for platfomr Prorealtime v 10.3 by bolsatrilera
srcfast = close
lenfast = 5 //minval=1, title="Length Fast RSI")
srcslow = close
lenslow = 14 //minval=1, title="Length Slow RSI")
upfast =WilderAverage[lenfast](max(close-close[1],srcfast))
downfast =WilderAverage[lenfast](-min(close-close[1],srcfast))
if downfast = 0 then
rsifast =100
elsif upfast =0 then
rsifast = 0
else
rsifast =100 - (100 / (1 + upfast / downfast))
endif
upslow =WilderAverage[lenslow](max(close-close[1],srcslow))
downslow =WilderAverage[lenslow](-min(close-close[1],srcslow))
if downslow = 0 then
rsislow =100
elsif upslow =0 then
rsislow=0
else
rsislow =100 - (100 / (1 + upslow / downslow))
endif
divergence = rsifast - rsislow
if divergence > 0 then
r=0
g=255
b=0
else
r=255
g=0
b=0
endif
return divergence coloured (r,g,b)as "rsi divergence", 0 style(dottedline)as "0"
Thanks bolsatrilera!
@Ritesh
>> Please update your country flag in your profile. Thank you 🙂 <<
Amazing work Nicholas. You are superb