From c50836c2b8776b4e24731b05eaf8867c964286e6 Mon Sep 17 00:00:00 2001 From: moshferatu Date: Mon, 30 Oct 2023 05:16:11 -0700 Subject: [PATCH] Add McClellan Summation Index indicator --- mcclellan_summation_index.pine | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 mcclellan_summation_index.pine 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