CrossAbove(EMA(10), EMA(20), 1)
but I want to make the EMA(10) part generic. I may use EMA or WMA, so I can't hard code specific data series name.
I want to do this:
CrossAbove(MA_Fast, MA_Slow, 1)
where MA_Fast would be the value EMA(10) or WMA(10)
I don't know C# well enough to do this. If I put "EMA(10)" into a string var MA_Fast, won't it try passing the string to CrossAbove instead of the data series?
In shell parlance, I want to expand the string variable before the CrossAbove call is made, which is done using the shell command eval. This could be done using a pre-processor, but that is overkill.
What is the C# way of doing this?
I sort of got there with this syntax I saw:
EMA MA_Fast = EMA(fastperiod);
This allowed me to call CrossAbove(MA_Fast, ...)
But when I tried to use this for different MA calls, I can't redefine the local variable. I'm not sure what this syntax really means: MA_Fast is a variable of type EMA which is a pointer to the indicator function?
Please help - I'm new to C#. Thanks.
Comment