Lipi Reference Lipi

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 The series to take the median of.
length required series int How many bars the window covers.

Return Type

series float

Example


          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")