Add McClellan Summation Index indicator
This commit is contained in:
parent
064454c085
commit
c50836c2b8
13
mcclellan_summation_index.pine
Normal file
13
mcclellan_summation_index.pine
Normal 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)
|
Loading…
Reference in New Issue
Block a user