Name

CalcMedian — Calculate median (a middle element)

Synopsis

CalcMedian (ARRAY,
  ARRAY_OR_NUMBER);

Returns

ARRAY

Parameters

Name Type Default Description
ARRAY array
ARRAY_OR_NUMBER array_or_number

Description

This function is inspired by AmiBroker function: www.amibroker.com/guide/afl/median.html

Difference from AmiBroker: R and Excel give the same results in tests. Amibroker is wrong. See <ulink url="files/Median_AmibrokerIsWrong.xlsx">Median_AmibrokerIsWrong.xlsx</ulink>

Calculate median (a middle element)