mad

mad(series, period)
Parameters
  • series (series) – Input series

  • period (integer) – Input period

Returns

series

Returns the mean absolute deviation of the series over the last period bars.

\[\begin{split}\overline{x} &= \frac{\sum_{i=0}^{n-1}x_i}{n}\\ \mathrm{MAD} &= \frac{\sum_{i=0}^{n-1}|x_i - \overline{x}|}{n}\end{split}\]