【TradingViewインジケータ#5】シンプルなRCI@コピペでOK
シンプルなRCIインジケータ
//RCI関数
rci(src, len) =>
d=0
for i=0 to len -1
drank = i+1
prank = 1
for j = 0 to len - 1
if src[drank-1]<src[j]
prank+=1
d+=(drank-prank)*(drank-prank)
rcivalue=(1-(6*d/(len*len*len-len)))*100
//@version=4
study(title = "シンプルなRCI")
RCIHighBaseLine=input(title="RCIの上側の閾値", type=input.integer, defval=80,minval=1,maxval=99)
RCILowBaseLine=input(title="RCIの下側の閾値", type=input.integer, defval=-80,minval=-1,maxval=-99)
RCIlength=input(title="RCI期間", type=input.integer, defval=13)
highlevel=line.new(x1=bar_index,y1=RCILowBaseLine,x2=bar_index[2],y2=RCILowBaseLine,extend=extend.both,color=#0F24EB,width=1)
highlevel2=line.new(x1=bar_index,y1=RCILowBaseLine-10,x2=bar_index[2],y2=RCILowBaseLine-10,extend=extend.both,color=#0F24EB,width=1)
lowlevel=line.new(x1=bar_index,y1=RCIHighBaseLine,x2=bar_index[2],y2=RCIHighBaseLine,extend=extend.both,color=#0F24EB,width=1)
lowlevel2=line.new(x1=bar_index,y1=RCIHighBaseLine+10,x2=bar_index[2],y2=RCIHighBaseLine+10,extend=extend.both,color=#0F24EB,width=1)
RciLine=rci(close,RCIlength)
plot(RciLine,color=#E6621A)
この記事が気に入ったらサポートをしてみませんか?