Indicator found in Tradingview website:
https://www.tradingview.com/script/SYXp2cAq-CCI-Cycle-Modified-Schaff-Trend-Cycle/
Code:
//@version=3
study(title=”CCI Cycle”, shorttitle=”CCI Cycle”, overlay=false)
// ——————————- Inputs ——————————- //
src = input(close, title=”Source”)
length=input(10)
useCurrentRes = input(true, title=”Use Current Chart Resolution?”)
resCustom = input(“240″, title=”Use Different Timeframe? Uncheck Box Above”)
res = useCurrentRes ? period : resCustom
// ——————————- CCI ——————————- //
ma = sma(src, length)
cci = (src – ma) / (0.015 * dev(src, length))
ccis = security(tickerid, res, rma(2*ema(cci, length/2)-ema(cci, length), round(sqrt(length))))
// ——————————- Cycle ——————————- //
ccic(length) =>
factor=input(0.5)
m = ccis
v1 = lowest(m, length)
v2 = highest(m, length) – v1
f1 = 0.0
f1 := (v2 > 0 ? ((m – v1) / v2) * 100 : nz(f1[1]))
pf = 0.0
pf := (na(pf[1]) ? f1 : pf[1] + (factor * (f1 – pf[1])))
v3 = lowest(pf, length)
v4 = highest(pf, length) – v3
f2 = 0.0
f2 := (v4 > 0 ? ((pf – v3) / v4) * 100 : nz(f2[1]))
pff = 0.0
pff := (na(pff[1]) ? f2 : pff[1] + (factor * (f2 – pff[1])))
pff
CCIC = security(tickerid, res, ccic(length))
// ——————————- Plotting ——————————- //
plot(CCIC,color=red, title=”CCI Cycle”)
ul=plot(25)
ll=plot(75)
fill(ul,ll,color=red)
It should be very similar to Schaff indicator but with earlier signals.
If you go at the abocìve reported web link you can also find how it look like!
Thanks a lot in advance