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
ParameterTypeRequiredDescription
sourceseries floatyesThe series to take the median of.
lengthseries intyesHow 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.
Upgrade