Median

Statistical functions 
SYNTAX  Median( array, period ) 
RETURNS  ARRAY 
FUNCTION  The Median function  finds median (middle element) value of the array over period elements. Note that LOWER median is returned when 'period' is an even number. If you want to get average of upper and lower median for even 'periods' you need to use Percentile( array, period, 50 ) instead. It will do the averaging for you but runs slower. 
EXAMPLE  // list only symbols which
volume is greater than 
SEE ALSO  Percentile() function 
The Median function is used in the following formulas in AFL online library:
See updated/extended version online.