*** EDIT*** The other, related issue is that it looks like the "NinjaTrader.NinjaScript.Indicators" (also "NinjaTrader.NinjaScript.AddOns" and the other top-level namespaces) are magic in a lot of places, such as code gen, import and export. This is really problematic in that it basically restricts code in these folders/namespaces to a single file. IMO, this is just not realistic and definitely was not the case with NT7. Hopefully this is just an oversight and isn't by design.
1) Add the 2 attached scripts to the Indicators folder. Compile. Notice the indicator uses the helper class in the (State == State.Configure) block.
2) Export the files (see attached image).
3) An invalid .cs is created which can't be compiled during import. See red highlights...
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private MyCustomIndicator[] cacheMyCustomIndicator;
private Some.Namespace.[] cacheSome.Namespace.;
public MyCustomIndicator MyCustomIndicator()
{
return MyCustomIndicator(Input);
}
public Some.Namespace. Some.Namespace.()
{
return Some.Namespace.(Input);
}
public MyCustomIndicator MyCustomIndicator(ISeries<double> input)
{
if (cacheMyCustomIndicator != null)
for (int idx = 0; idx < cacheMyCustomIndicator.Length; idx++)
if ( cacheMyCustomIndicator[idx].EqualsInput(input))
return cacheMyCustomIndicator[idx];
return CacheIndicator<MyCustomIndicator>(new MyCustomIndicator(), input, ref cacheMyCustomIndicator);
}
public Some.Namespace. Some.Namespace.(ISeries<double> input)
{
if (cacheSome.Namespace. != null)
for (int idx = 0; idx < cacheSome.Namespace..Length; idx++)
if ( cacheSome.Namespace.[idx].EqualsInput(input))
return cacheSome.Namespace.[idx];
return CacheIndicator<Some.Namespace.>(new Some.Namespace.(), input, ref cacheSome.Namespace.);
}
}
Comment