Based on the description in Murphy, Tech. Analysis of Financial Markets. Wikipeadia also has a good description:
en.wikipedia.org/wik...McClellan_oscillator
Without warranty - please trade based on your own analysis and let me know if you find any errors in the script.
en.wikipedia.org/wik...McClellan_oscillator
Without warranty - please trade based on your own analysis and let me know if you find any errors in the script.
study(title = "McClellan Summation Index", shorttitle="MCSI") sym(s) => security(s, period, close) difference2 = sym("ADVN") - sym("DECN") advnema19 = ema(difference2, 19) advnema39 = ema(difference2, 39) osci = advnema19-advnema39 maout = cum(osci) plot(maout, title="MCSI", color=red)