Thanks Zondor for this.
Quick question - I tried to convert it into a signal generator, looking into the built-in NT8 MovingAverage example - however, what I've seen is that the indicator values are computed at the end of the cycle, after OnBarUpdate parsed all the Chart bars ... hence you don't have access to the indicator values while OnBarUpdate goes bar-by-bar, but rather, at the end, after the last bar.
Do you see a way to actually use this for signal generation at all?