Add McClellan Summation Index indicator

This commit is contained in:
moshferatu 2023-10-30 05:16:11 -07:00
parent 064454c085
commit c50836c2b8

View File

@ -0,0 +1,13 @@
//@version=5
indicator("McClellan Summation Index")
var previousIndexValue = float(na)
advances = request.security("ADVN", "D", close)
declines = request.security("DECN", "D", close)
oscillatorValue = ta.ema(advances - declines, 19) - ta.ema(advances - declines, 39)
indexValue = nz(previousIndexValue) + oscillatorValue
previousIndexValue := indexValue
plot(indexValue)