median
Syntax Format
median(series, period)
Overview
The median
function provides the median value for the given series type over a certain period. This function is usually used in the scripts, where data smoothing is performed to reduce the noise and highlight more prominent price movements. You can also use this function as a standalone indicator, showing the median value of the series over a certain timeframe.
To receive the same data, you can use the percentile_nearest_rank
function as well:
percentile_nearest_rank (series, period, 50)
Parameters
Parameter | Type | Purpose |
---|---|---|
series | series | Input value, taken into calculation |
period | integer | Input period, taken into calculation |
Returns: series
.
Example
median_data = median(high, 14)