median
forge.tafunctionSince Forge API 1
Functionpython
forge.ta.median(source: ArrayLike, period: int = 20) -> np.ndarrayMedian of the last period values. NaN where the window holds a missing value.
Parameters
| Name | Type | Default |
|---|---|---|
| source | ArrayLike | |
| period | int | 20 |
Classpython
forge.ta.Median(**inputs: Any) -> NoneMiddle value of the last N values, so one spike cannot move it.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| source | source | close | |
| period | int | 20 | 1 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.