diff --git a/mcclellan_summation_index.pine b/mcclellan_summation_index.pine new file mode 100644 index 0000000..14266ee --- /dev/null +++ b/mcclellan_summation_index.pine @@ -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) \ No newline at end of file