I'v begun to program a custom indicator. But I can't figure out how to calculate a simple median of n values in c#. I want to calculate the median of the recent 4 troughs in MACD. I have stored the 4 values in an array, but as it looks in the c# reference one has to use a Series with the median function in the Statistic class.
http://msdn.microsoft.com/en-us/library/system.web.ui.datavisualization.charting.statistic formula.mean(VS.100).aspx
Is there another simpler way to calculate the median?
If not, how do you declare a Series with 4 values and how do you asign the 4 values to it?
/Andreas
Comment