median

forge.tafunctionSince Forge API 1
Functionpython
forge.ta.median(source: ArrayLike, period: int = 20) -> np.ndarray

Median of the last period values. NaN where the window holds a missing value.

Parameters

NameTypeDefault
sourceArrayLike
periodint20

Indicator: Rolling median

Classpython
forge.ta.Median(**inputs: Any) -> None

Middle value of the last N values, so one spike cannot move it.

Inputs

NameTypeDefaultRange
sourcesourceclose
periodint201 to 5000

Median[i] = the middle of the sorted values x[i-period+1] to x[i]

With an even period it is the mean of the two middle values. A window holding a missing value has no value.