I would like to build a new custom indicator based on another which is closed source. I have tried to follow https://forum.ninjatrader.com/forum/...ther-indicator and https://forum.ninjatrader.com/forum/...-are-not-plots but it seems I am doing something wrong, as I get errors either on the constructor:
private IndicatorClosed indicatorClosed = new IndicatorClosed("P1", "P2", 10);
'NinjaTrader.NinjaScript.Indicators.IndicatorClose d' does not contain a constructor that takes 3 arguments
The definition available to me for the closed source indicator is:
namespace NinjaTrader.NinjaScript.Indicators {
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase {
private IndicatorClosed[] cacheIndicatorClosed;
public IndicatorClosed IndicatorClosed(string p1, string p2, string p3) {
return IndicatorClosed(Input, p1, p2, p3);
}
public IndicatorClosed IndicatorClosed(ISeries<double> input, string p1, string p2, string p3) {
// ...
}
}
}
private IndicatorClosed indicatorClosed;
...
indicatorClosed = IndicatorClosed("P1", "P2", 10);
It builds but then I get the runtime error:
Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
Do you know how I should instantiate the closed indicator so I can access the various data series generated by the closed indicator ?
Thanks in advance

Comment