talib.median
The middle value of the last length values of source.
It sits alongside talib.mode and the two percentile functions: all four summarise a window of values rather than average it.
talib.median(series float source, series int length) → series float| Parameter | Type | Required | Description |
|---|---|---|---|
source | series float | yes | The series to take the median of. |
length | series int | yes | How many bars the window covers. |
Returns series float — A series float.
indicator("Median close of 20 bars")
plot(talib.median(close, 20))See also talib.alma · talib.atr · talib.barssince
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.