Can someone help convert RCI3lines to ThinkorSwim?

P

poparhon

New member
I found an indicator on trading view called RCI3lines, Rank Correlation Index. This indicator compliments the Ichimoku . I tried the Spearman indicator which only plots two lines here on TOS and it is missing one more input value box needed to plot the third line. Appreciate any help, Thanks
 
BenTen

BenTen

Administrative
Staff
VIP
I suggest including all relevant links from your request, so it's easier for us to know exactly what you're talking about.
 
P

poparhon

New member
I suggest including all relevant links from your request, so it's easier for us to know exactly what you're talking about.
Having someone who can take the Trading View script and convert it over to TOS
 
BenTen

BenTen

Administrative
Staff
VIP
@poparhon No, I meant you should include all the links from TradingView related to your request in the post, so people know exactly what you're talking about. Don't just mention Rank Correlation Index or RCI3lines. Give us the link to the script, as well.
 
P

poparhon

New member
Code:
//
// @author Jadbrother modified by gero
//
//@version=2
study(title = "RCI3lines", shorttitle = "RCI3lines")

itvs = input(9, "short interval")
itvm = input(26, "middle interval")
itvl = input(52, "long interval")
src = input(close, "source")
upperband=input(title="High line[%]",defval=80,type=integer)
middleband=input(title="Mid line[%]",defval=0,type=integer)
lowerband=input(title="Low line[%]",defval=-80,type=integer)

ord(seq, idx, itv) =>
    p = seq[idx]
    o = 1
    s = 0
    for i = 0 to itv - 1
        if p < seq[i]
            o := o + 1
        else
            if p == seq[i]
                s := s+1
                o+(s-1)/2.0
    o

d(itv) =>
    sum = 0.0
    for i = 0 to itv - 1
        sum := sum + pow((i + 1) - ord(src, i, itv), 2)
    sum

rci(itv) => (1.0 - 6.0 * d(itv) / (itv * (itv * itv - 1.0))) * 100.0

hline(upperband,color=gray,linestyle=dashed)
hline(lowerband,color=gray,linestyle=dashed)
hline(middleband,color=gray,linestyle=dashed)
plot(rci(itvs), title = "RCI short", color = red)
plot(rci(itvm), title = "RCI middle", color = blue)
plot(rci(itvl), title = "RCI long", color = green)
 
Last edited:
P

poparhon

New member
@BenTen here is the code from trading view, converted to TOS
 
P

poparhon

New member
@horserider I have posted the script, would you be willing to take a look and see if this can be converted over to TOS, Thank you
 
horserider

horserider

Well-known member
VIP
@poparhon Sorry not a TV expert, maybe someone else here can help. Good luck.
 
markos

markos

Well-known member
VIP
Looks like a strange MACD type thing-a-ma-bob. I'd take a shot but Pinescript isn't something I have time for, unfortunately.
 

Similar threads

Top