Rolling median

medianmoving_averagesForge API 1

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

Inputs

NameTypeDefaultRange
sourcesourceclose
periodint201 to 5000

Outputs

NameTypeRequiredDescription
medianvalueOptionalcolor theme.accent, style line, width 1
Warm-up
period - 1 bars (19 at the defaults)
Repaints
No
Parity
None

Formula

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.