TradingView
merlock
18 de Abr de 2020 14:21

McClellan Summation Index - Miekka Formula 

US Nas 100OANDA

Descrição

This indicator is the McClellan Summation Index calculated as by Jim Miekka. Jim was a renowned mathematician who contributed immensely to the trading world by tying to develop independent mathematical indicators.

It was Jim Miekka who established the independent relationship to calculate the Summation index without calculating the cumulative of the McClellan Oscillator.

On top of the Summation Index I have added a 10 EMA to easily identify a change in trend.

I would recommend a user to read more about the Summation index and its utilities before using this indicator.
Comentários
rmm131995
hi bro im trying to create a new indicator using the mcclellan summation code. i took the code from lazybear but i think yours is valid too.
i try to change the original code (this the code)

advissues=input(defval="ADVN", title="Advancing Stocks Symbol", type=symbol)
decissues=input(defval="DECN", title="Declining Stocks Symbol", type=symbol)
isRA=input(true, title="Stockcharts version (Ratio Adjusted)?")
rm=input(defval=1000, title="RANA ratio multiplier")

useCTF=input(false, title="Use Custom Timeframe?"),
tf=useCTF?input("D", type=resolution, title="Custom Timeframe"):period
ai=security(advissues, tf, close), di=security(decissues, tf, close)
rana=rm * (ai-di)/(ai+di)
e1=isRA?ema(rana, 19):ema(ai-di, 19),e2=isRA?ema(rana, 39):ema(ai-di, 39)
mo=e1-e2,msi=nz(msi[1])+mo

hline(0, title="ZeroLine")
plot(msi<0?msi:0, style=area, color=red, title="MSI_Negative")
plot(msi>=0?msi:0, style=area, color=green, title="MSI_Positive")
plot(msi, style=line, color=black, title="MSI", linewidth=2)

to this one
ad() =>
math.sign(close - close[1])
m1 = nz(request.security('BINANCE:BTCUSDT', timeframe.period, ad()))
...more of this 40 times

u(x) =>
math.max(x, 0)
d(x) =>
-math.min(x, 0)

ai = u(m1) + u(m2) + u(m3) + u(m4) + u(m5) + u(m6) + u(m7) + u(m8) + u(m9) + u(m10) + u(m11) + u(m12) + u(m13) + u(m14) + u(m15) + u(m16) + u(m17) + u(m18) + u(m19) + u(m20) + u(m21) + u(m22) + u(m23) + u(m24) + u(m25) + u(m26) + u(m27) + u(m28) + u(m29) + u(m30) + u(m31) + u(m32) + u(m33) + u(m34) + u(m35) + u(m36) + u(m37) + u(m38) + u(m39) + u(m40)
di = d(m1) + d(m2) + d(m3) + d(m4) + d(m5) + d(m6) + d(m7) + d(m8) + d(m9) + d(m10) + d(m11) + d(m12) + d(m13) + d(m14) + d(m15) + d(m16) + d(m17) + d(m18) + d(m19) + d(m20) + d(m21) + d(m22) + d(m23) + d(m24) + d(m25) + d(m26) + d(m27) + d(m28) + d(m29) + d(m30) + d(m31) + d(m32) + d(m33) + d(m34) + d(m35) + d(m36) + d(m37) + d(m38) + d(m39) + d(m40)

isRA = input(true, title='Ratio Ajustado')
rm = input(defval=1000, title='Multiplicador RANA')

gaps = barmerge.gaps_off
src = close

rana = rm * (ai - di) / (ai + di)
e1=isRA?ta.ema(rana, 19):ta.ema(ai-di, 19),e2=isRA?ta.ema(rana, 39):ta.ema(ai-di, 39)
mo=e1-e2,msi=nz(msi[1])+mo

hline(0, title='0')
plot(msi < 0 ? msi : 0 , style=plot.style_area, color=color.new(color.red, 0), title='-')
plot(msi >= 0 ? msi : 0 , style=plot.style_area, color=color.new(color.green, 0), title='+')
plot(msi , style=plot.style_line, color=color.new(color.black, 0), title='MSI', linewidth=1)

but isnt working: line 71 Undeclared identifier 'msi'. the code is almost identical, do you know whats could be wrong?
thanks in advance
merlock
@rmm131995, Hi, Thanks for getting in touch. I was unable to locate the issue myself. Feels like it is an issue with the Pine coding itself. May I suggest getting in touch this with guy, (www<dot>fiverr<dot>com/hiubriss)

I have used his services a couple of times to get custom indicators done and he is the best and is not very expensive. You may be able get it done through his for as less as $10 USD. Good luck and let me know how it goes.
rmm131995
@merlock, thanks bro i'll do it
Mais