I'm trying to use a custom indicator from within a strategy I call myTrader.
I invoke it in the following manner:
else if (State == State.Configure)
{
// myIndie = myCustomIndicator(true, false);
// AddChartIndicator(myIndie );
AddChartIndicator(myCustomIndicator(true, false));
I prefer the commented out approach, because from within the strategy's OnBarUpdate handler I would like to grab the current values of some public (myCustomIndicator) indicator variables using the following format:
double signalEntryPrice = myIndie.signalEntryPrice;
instead of having to state it as follows:
double signalEntryPrice = myCustomIndicator(true, false).signalEntryPrice;
which seems to be not quite appropriate, since it implies this way will construct another instance of the indicator...
I am unable to use my preferred approach, because the compiler generates an eror when trying to treat the myCustomIndicator indicator like a class in the following:
private myCustomIndicator myIndie ;
'NinjaTrader.NinjaScript.Strategies.Strategy.myCus tomIndicator(bool, bool)' is a 'method' but is used like a 'type'
What am I doing wrong?

Comment