I am newish to C# and new to NT and so forgive the question...
From within a strategy I would like to access an Indicator by reference. The reason for doing this is so that I do not have to search and replace the name of the indicator in multiple spots within the strategy when I want to use a new indicator (with a different name but same input and output parameters).
When using the indicator within the strategy this works fine and passes me back the value of "NewStop1"....
exitLongStopT1Price = MyIndicator(orderPrice, BarsSinceEntry(), exitLongStopT1Price, "Long").NewStop1[0];
this does not work....
Indicator.MyIndicator refindicator= new Indicator.MyIndicator();
exitLongStopT1Price = refindicator(orderPrice, BarsSinceEntry(), exitLongStopT1Price, "Long").NewStop1[0];
I get an error saying "refindicator is a Variable but is used like a Method". I have tried several combinations of () and [] to no avail. In the end, I'm stumped.
Also, in the MyIndicator, I have the parameters defined as follows.
[Description("")]
[GridCategory("Parameters")]
public double AveragePrice1
{
get { return averagePrice1; }
set { averagePrice1 = value; }
}
The Indicator works fine and, again, if I call it directly from within the strategy it works fine. I have not made any out of the ordinary customizations to the Indicator. Any help or sample code would be greatly appreciated.

Comment