Translate indicators please.
Forums › ProRealTime English forum › ProOrder support › Translate indicators please.
- This topic has 10 replies, 3 voices, and was last updated 1 year ago by nachovelher.
-
-
11/04/2022 at 7:34 PM #20355711/04/2022 at 7:41 PM #203558
//
// @author Jadbrother modified by gero modified by ChaosTrader63
//
//@version=3
// @BGColor mod by goku972
study(title = “RCI 3 Lines”, shorttitle = “RCI3lines+BG”)
itvs = input(9, “short interval”)
itvm = input(26, “middle interval”)
itvl = input(52, “long interval”)
lengthSlope = input(1)
src = input(close, “source”)
upperband=input(title=”High line[%]”,defval=80,type=integer)
lowerband=input(title=”Low line[%]”,defval=-80,type=integer)
middleband=input(title=”Middle line[%]”,defval=-0,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=red,linestyle=dashed)
hline(lowerband,color=red,linestyle=dashed)
hline(middleband,color=green,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)
//BG Color by RCI Long Line
//bgcolor(falling(rci(itvl), lengthSlope) ? maroon : (rising(rci(itvl), lengthSlope) ? green : black), transp=70)
//BG Color by RCI Middle Line
//bgcolor(falling(rci(itvm), lengthSlope) ? maroon : (rising(rci(itvm), lengthSlope) ? green : black), transp=70)
//BG Color by RCI Short Line
bgcolor(falling(rci(itvs), lengthSlope) ? maroon : (rising(rci(itvs), lengthSlope) ? green : black), transp=70)
11/04/2022 at 7:45 PM #203559//
// @author Jadbrother modified by gero, optimized by yuza
//
//@version=3
study(title = “RCI3lines optimized”, shorttitle = “RCI3lines opt”)
itvs = input(9, “short interval”)
itvm = input(26, “middle interval”)
itvl = input(52, “long interval”)
src = input(close, “source”)
res = input(9, “resolution”, minval=9)
upperband=input(title=”High line[%]”,defval=80,type=integer)
lowerband=input(title=”Low line[%]”,defval=-80,type=integer)
dmul = 600 / res / (res*res-1)
ord(seq, idx, itv) =>
p = seq[idx]
o = 0.5
for i = 0 to res-1
d = (p – seq[i*itv])
o := o + ((d<0) ? 1 : ((d==0) ? 0.5 : 0))
o
d(itv) =>
sum = 0.0
step = itv/res
for i = 0 to res-1
x = (i + 1) – ord(src, i*step, step)
sum := sum + x*x
sum
rci(itv) => sma(100.0 – dmul * d(itv), ceil(itv/res))
hline(upperband,color=gray,linestyle=dashed)
hline(lowerband,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)
11/05/2022 at 3:41 PM #20359611/05/2022 at 5:19 PM #20359911/05/2022 at 5:22 PM #20360011/07/2022 at 9:47 AM #20374306/07/2023 at 7:21 PM #215782Hi there,
I’m also interested in that indicator, I think it is quite interesting. I’m sorry the guy who opened this post didn’t have better manners.
I attach you a screenshot of the indicator, if you need something else let me know.
Thank you,
Nacho
06/12/2023 at 7:31 PM #216024Hello,
I have found this code through the web too, not sure if it can be useful to you:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657## RCI_3_Lines is simply 3 instances of the Spearman indicator# set to lengths 9, 36 and 52. I eliminated the Spearman Average line.# pieced together by @RickKennedy, thinkscript.com, 2020/11/22declare lower;input price = close;input length_9 = 9;input length_36 = 36;input length_52 = 52;input averageLength = 3;input over_bought = 80;input over_sold = -80;input showBreakoutSignals =yes;# instance 9 lengthassert(length_9 >= 2, "'length' must be greater than or equal to 2: " + length_9);def sumSqr9 = fold i9 = 0 to length_9 with sum9 dosum9 + Sqr((length_9 - i9) - fold j9 = 0 to length_9 with rank9do rank9 + if GetValue(price, i9, length_9 - 1) > GetValue(price, length_9 - j9 - 1) or GetValue(price, i9) == GetValue(price, length_9 - j9 - 1) and i9 <= length_9 - j9 - 1 then 1 else 0);# instance 36 lengthassert(length_36 >= 2, "'length' must be greater than or equal to 2: " + length_36);def sumSqr36 = fold i36 = 0 to length_36 with sum36 dosum36 + Sqr((length_36 - i36) - fold j36 = 0 to length_36 with rank36do rank36 + if GetValue(price, i36, length_36 - 1) > GetValue(price, length_36 - j36 - 1) or GetValue(price, i36) == GetValue(price, length_36 - j36 - 1) and i36 <= length_36 - j36 - 1 then 1 else 0);# instance 52 lengthassert(length_52 >= 2, "'length' must be greater than or equal to 2: " + length_52);def sumSqr52 = fold i52 = 0 to length_52 with sum52 dosum52 + Sqr((length_52 - i52) - fold j52 = 0 to length_52 with rank52do rank52 + if GetValue(price, i52, length_52 - 1) > GetValue(price, length_52 - j52 - 1) or GetValue(price, i52) == GetValue(price, length_52 - j52 - 1) and i52 <= length_52 - j52 - 1 then 1 else 0);# plotsplot Spearman9 = 100 * (1 - 6 * sumSqr9 / (length_9 * (Sqr(length_9) - 1)));plot Spearman36 = 100 * (1 - 6 * sumSqr36 / (length_36 * (Sqr(length_36) - 1)));plot Spearman52 = 100 * (1 - 6 * sumSqr52 / (length_52 * (Sqr(length_52) - 1)));plot OverBought = over_bought;#plot ZeroLine = 0;plot OverSold = over_sold;Spearman9.SetDefaultColor(GetColor(9));Spearman36.SetDefaultColor(GetColor(5));Spearman52.SetDefaultColor(GetColor(6));OverBought.SetDefaultColor(GetColor(3));#ZeroLine.SetDefaultColor(GetColor(3));OverSold.SetDefaultColor(GetColor(3));Thank you06/13/2023 at 8:47 AM #216102I believe this is the same indicator as RCI but with 3 different periods, please see available codes here:
https://www.prorealcode.com/topic/rci-indicator-conversion/
06/13/2023 at 7:26 PM #216163Thank you Nicolas, that’s exactly what I was looking for, really appreciate it.
-
AuthorPosts
Find exclusive trading pro-tools on