Exported using NT Version 7.0.1000.3
Besides the average there are other statistical measures to describe the behavior of a sample of n values. One of these measures the median, which is the numeric value separating the higher half of the sample from the lower half of the sample. In case that the number n of the values of the sample is even, the median is defined as the mean of the two middle values.
The median is statistically more robust than any average, as it does not take into account outliers or black swans. A moving average can be replaced with the moving median for many purposes.
This indicator calculates the moving median by writing the last n values to an array, sorting the array and selecting the middle value - or in case that n is even, the two middle values of the sample.
The NinjaScript method GetMedian() is not used, because it is flawed.
Category NinjaTrader 7 Indicators
|
|
|