Status
Not open for further replies.

#### poparhon

##### New member
The RCI3lines for ThinkOrSwim can be found in the above link, feel free to continue discussion there. This thead is locked

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

Last edited by a moderator:
I suggest including all relevant links from your request, so it's easier for us to know exactly what you're talking about.

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

@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.

I believe RCI3 is a 3 MA oscillator.

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:
@BenTen here is the code from trading view, converted to TOS

@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

@poparhon Sorry not a TV expert, maybe someone else here can help. Good luck.

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.

Awhile back, @poparhon requested that someone consider converting a TradingView script into thinkscript. That request was here: https://usethinkscript.com/threads/can-someone-help-convert-rci3lines-to-thinkorswim.1251/ . Unfortunately, he didn't really 'sell' it very well and I think it might be something that warrants another look. It looks pretty solid to me and it could be good to have in your toolbox.

I've included an image below and also the TV code if anyone wants to take a stab at converting it.

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)

//end of code``````

Rick, thanks. I think something is wrong with code.
Maybe we can use this with the Acc Dist CCI strategy. The strategy is amzing from my point of view and we should work on the details.
Let us improve it together. Thanks

Rick, thanks. I think something is wrong with code.
Maybe we can use this with the Acc Dist CCI strategy. The strategy is amzing from my point of view and we should work on the details.
Let us improve it together. Thanks

Sounds great. Yeah, that's a staple indicator for me. Still trying to figure out how to hit it just right though. I was thinking that if the RCI_3Lines could be converted for TOS, it could be combined with the AccDist_CCI strat to (hopefully) make absolute surefire signals.

Question: you didn't think the code I posted above was thinkscript, did you? That's the original pinescript from Trading View.

Sorry @BenTen, I thought that a new post might gain some new eyeballs. Wow! The admin chores on this site must keep you busy.

I thought it is a TOS Code first, sorry. The basic of your ACC CCI strategy is amazing. I think Gehege is only a small piece of the Puzzle to solve. Let us work on that.

I thought it is a TOS Code first, sorry. The basic of your ACC CCI strategy is amazing. I think Gehege is only a small piece of the Puzzle to solve. Let us work on that.

Gehege? I think I missed something along the way. What's Gehege?

Sorry I meant “there is only...“
I am from Switzerland and the sometimes the words in English get a German suggestion

Sorry I meant “there is only...“
I am from Switzerland and the sometimes the words in English get a German suggestion

Hahaha..... that's funny. Before I posted that I actually googled the def of gehege and I saw that there was a german language connection.

Eureka! Well, sort of.

Through some sleuthing on the google machine I found out that the RCI_3_Lines indicator is nothing other than 3 instances of the Spearman indicator. So, I pieced it together and, behold....the RCI_3_Lines indicator (below).

I was happy to have figured this out on my own, but as it turns out I'm not so thrilled with the indicator after all. I added some alerts to see what scenarios might work, but they were very inconsistent so I commented them out. You can turn them back on by editing the code.

Anyway, unless someone can come up with a good use for this in terms of entries, exits, etc. .... I'm sort of done with this:

The Indicator can be found in the above link, feel free to continue discussion there. This thead is locked.

Last edited by a moderator:
Status
Not open for further replies.

87k+ Posts
276 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?