Functions
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.
Syntax
talib.median(series float source, series int length) → series float
Arguments
source required series float Series of values to process. length required series int Number of bars (length). Return Type
series float Example
//@lipi=2
indicator("Median Price", overlay=true)
length = input(20, "Lookback Period")
source = input(close, "Source")
medianPrice = talib.median(source, length)
plot(medianPrice, color=color.blue, title="Median Price")