How can I write a wrapper function around a call to an indicator? Some indicators have a lot of inputs, and I call these indicators many times in a strategy. I would like to call the indicator once in a generic function, and then call the function in my strategy.
I tried this in my strategy, but the compiler complains:
private DataSeries GetMyIndicatorA ()
{
return MyIndicatorA(Input, ParamA, ParamB, ... ParamZ);
}
private DataSeries GetMyIndicatorB ()
{
return MyIndicatorB(Input, ParamA, ParamB, ... ParamZ);
}
and later in the strategy, for example...
if (CrossBelow(GetMyIndicatorA,GetMyIndicatorB, 1))
{
DoStuff();
}
I have done this in other languages, but C# is new to me. Or is this a DataSeries type / Ninjatrader thing?
Any help would be greatly appreciated. I am guessing there is a more sophisticated way to do this, but I am used to this method, and I like to keep things simple.
Thanks!
Comment