【TradingViewインジケータ#4】シンプルな3本のRCI@コピペでOK
シンプルな3本の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 = "シンプルな3本の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)
RCIShtlength=input(title="RCI短期", type=input.integer, defval=13)
RCIMdllength=input(title="RCI中期", type=input.integer, defval=26)
RCILnglength=input(title="RCI長期", type=input.integer, defval=52)
highlevel=line.new(x1=bar_index,y1=RCILowBaseLine,x2=bar_index[2],y2=RCILowBaseLine,extend=extend.both,color=#EB5654)
lowlevel=line.new(x1=bar_index,y1=RCIHighBaseLine,x2=bar_index[2],y2=RCIHighBaseLine,extend=extend.both,color=#EB5654)
RciShtLine=rci(close,RCIShtlength)
RciMdlLine=rci(close,RCIMdllength)
RciLngLine=rci(close,RCILnglength)
plot(RciShtLine,color=#E6621A)
plot(RciMdlLine,color=#EBDD12)
plot(RciLngLine,color=#3F87EB)
この記事が気に入ったらサポートをしてみませんか?