Both pc's run exactly the same NinjaTrader version 8.0.23.2.
The problem with this is that whenI want to create a variable of another indicator indicator on the pc that has no NinjaScript generated code region I get a message 'NinjaTrader.NinjaScript.Indicator.myReferencedInd icator is a type but is used as a variable'.
On the pc with that region everything compile fine.
Example:
The custom myReferencedIndicator has a 'Period' input (code not shown, but not important).
I try to reference this indicator in another custom indicator like this:
public class myNewIndicator : Indicator
{
private myReferencedIndicator indi1;
protected override void OnStateChange()
{
if (State==State.DataLoaded) {
indi1 = myReferencedIndicator(14);
}
}
}
I expect this is caused by the missing region, because that region defines a partial class for the 'Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase' class with the indicator constructors like this (which I see on the other pc that HAS the region):
namespace NinjaTrader.NinjaScript.Indicators
{
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private myReferencedIndicator[] cachemyReferencedIndicator;
public myReferencedIndicator myReferencedIndicator(int period)
{
return myReferencedIndicator(Input, period);
}
public myReferencedIndicator myReferencedIndicator(ISeries<double> input, int period)
{
if (cachemyReferencedIndicator != null)
for (int idx = 0; idx < cachemyReferencedIndicator.Length; idx++)
if (cachemyReferencedIndicator[idx] != null && cachemyReferencedIndicator[idx].Period == period && cachemyReferencedIndicator[idx].EqualsInput(input))
return cachemyReferencedIndicator[idx];
return CacheIndicator<myReferencedIndicator>(new myReferencedIndicator(){ Period = period}, input, ref cachemyReferencedIndicator);
}
}
}
So I also tried adding the constructor of the above partial class to the myReferencedIndicator class on the pc without the region, but that didn't help.
Anyone got an idea why one pc does generate the region during compile and the other doesn't?
PS: to be complete: my indicator is based on another indicator.
So the clas definition is not public class myNewIndicator : Indicator
But its public class myNewIndicator : myOtherIndicator, where my OtherIndicator is based on Indicator.
Anyone has a suggestion how to solve this on the pc without the region?

Comment