# CCT StochRSI [LazyBear]

6653瀏覽
CCT StochRSI, proposed by Steve Karnish of Cedar Creek Trading, reconfigures classic StochRSI using custom parameters and smoothing.

There are 6 types supported.

Common formula:
( rsi - lowest( rsi , x)) / (highest( rsi , y) - lowest( rsi , z)) * 100

Smoothed formula:
ema (common formula result, len )

Settings (values for x/y/z/len in the above formulae):
• Type 1: RSILength=21, x=8, y=13, z=13, len=N/A
• Type 2: RSILength=21, x=21, y=21, z=21, len=N/A
• Type 3: RSILength=14, x=14, y=14, z=14, len=N/A
• Type 4: RSILength=21, x=13, y=8, z=13, len=8
• Type 5: RSILength=5, x=5, y=5, z=5, len=3
• Type 6: RSILength=13, x=13, y=13, z=13, len=3

Apart from these default types, this also supports user-specified custom type (select "0" for "Type" option).

All 6 types:

CCT StochRSI compared against normal StochRSI:

List of my public indicators: http://bit.ly/1LQaPK8
List of my app-store indicators: http://blog.tradingview.com/?p=970
//
// @author LazyBear
//
// List of my public indicators: http://bit.ly/1LQaPK8
// List of my app-store indicators: http://blog.tradingview.com/?p=970
//
//
study("CCT StochRSI [LazyBear]", shorttitle="CCTSTOCHRSI_LB")
ull = input(90.0, title="Top Warning Line")
lll = input(10.0, title="Bottom Warning Line")
src = input(close)
u1=hline( 100, color=gray, title="Top Line")
l1=hline( 0, color=gray, title="Bottom Line")
u=hline( ull, color=gray, title="Top Warning Line")
l=hline( lll, color=gray, title="Bottom Warning Line")
fill(u1,u, red, title="Top Fill")
fill(l1,l, green, title="Bottom Fill")
hline(50, title="MidLine")
type=input(defval=1, title="Type (0=>Custom, 1 - 6 => Alerts levels 1 to 6)", maxval=6, minval=0)
r21=type==0?na:rsi(src, 21)
r14=type==0?na:rsi(src, 14)
r5 =type==0?na:rsi(src, 5)
r13=type==0?na:rsi(src, 13)
smoothed=input(false, title="[Custom] Smooth CCTStochRSI?")
lr=input(8, title="[Custom] RSI Length")
le=input(3, title="[Custom] EMA Length")
ls=input(9, title="[Custom] Signal Length")
al1=type==1?(r21-lowest(r21,8))/(highest(r21,13) - lowest(r21,13))*100:na
al2=type==2?(r21-lowest(r21,21))/(highest(r21,21) - lowest(r21,21))*100:na
al3=type==3?(r14-lowest(r14,14))/(highest(r14,14) - lowest(r14,14))*100:na
al4=type==4?ema((r21-lowest(r21,13))/(highest(r21,8) - (lowest(r21+.00001,13))),8) * 100:na
al5=type==5?ema((r5-lowest(r5,5))/(highest(r5,5) - (lowest(r5,5))),3) * 100:na
al6=type==6?ema((r13-lowest(r13,13))/(highest(r13,13) - (lowest(r13,13))),3) * 100:na

// Custom
r = type==0?rsi(src, lr):na
cctstr_ = type==0?( r - lowest( r, lr )) / (( highest( r, lr )) - lowest( r, lr )):na
cctsrc=type==0?smoothed?ema(cctstr_,le)*100 : cctstr_*100:na
cctsr=type==0?cctsrc:type==1?al1:type==2?al2:type==3?al3:type==4?al4:type==5?al5:type==6?al6:na
e=ema(cctsr, ls)
plot( cctsr , color=black, linewidth=2, title="CCT StochRSI")
plot( e, color=red, linewidth=2, title="Signal")

List of my free indicators: http://bit.ly/1LQaPK8
List of my indicators at Appstore: http://blog.tradingview.com/?p=970

## 評論

Sir, in the StochRSI settings, what does the %K and %D stand for? I have been able to derive simple StochRSI based on Tushar Chande's formula
StochRSI = (RSI - Lowest Low RSI) / (Highest High RSI - Lowest Low RSI), but the TradeView's Stochastic RSI has other parameters, which I am unable to figure out. I want to derive in Excel sheet. Please help.