when calling an existing indicator as a method in another new indicator, this compiles fine, such as:
public double offset1;
protected override void OnBarUpdate()
{
offset1 = SMA(10)[0];
}
However, if the same call to SMA is made in a BarsTypes file, from within the OnDataPoint method it generates an error:
CS0118 : NinjaTrader.NinjaScript.Indicators.SMA is a 'type' but is used like a 'variable'
I'm thinking this is to be expected, i.e. we can't call an existing indicator as a method within a BarsTypes file,
but we can call an Indicator as a method from within another Indicator, is this correct ?
Alternatively, Is there a way to make use of an existing indicator, as a method within a BarsType file ?
Many thanks,
Louis

Comment