View Full Version : Indictor on Indicator
04-14-2007, 03:41 AM
I'm new to Ninja, trying the V6 Simulation. I can't seem to find how to apply an indicator to an indicator. For example a 5 period SMA to a MACD Histogram.Is this possible, can someone point me in the right direction?
04-14-2007, 04:21 AM
a) You can not configure an indicator on indicator by NT UI.
b) However you can code your own indicator by NinjaScript. To e.g. run an 14 period SMA on the MACD Diff (MACD has 3 data series: Macd, Avg and Diff), you could do something like this in your OnBarUpdate method:
protected override void OnBarUpdate()
Plot0.Set(SMA(MACD(12, 26, 9).Diff, 14));
I suggest starting of wizard generated indicator template and take it from there.
04-14-2007, 06:16 AM
Thanks, that works but it seems to limit me to four parameters. If I want to specify the MACD parameters and two SMA lines will I need to bypass the wizard and code it manually?
04-14-2007, 08:43 AM
Yes, you would need to manually add additional inputs.
04-14-2007, 08:53 AM
Great, got it working with five inputs. Thanks for the responses.