To show this I have built a small indicator, which displays the median of the last 3 closes on a chart. Indicator is attached. As you can see on the chart below, the value returned for the median is not the median of the closes, but something else (yellow line).
I have also coded an indicator, which calculates the correct median by writing values to an array and sorting them. This indicator shows on the chart as a magenta line.
Or is there anything that I did not understand?
By the way there is an unfortunate terminology, calling (H+L)/2 of a bar the median. This is no median but the center of the bar. The median is a statistical measure, as correctly described in the NinjaTrader help file for the NinjaScript method GetMedian(). So you can calculate a (statistical) median of a (false) median, but the results are false, anyhow.
Comment