Indicado.SMA.eval-exclamation-mark

You're seeing just the function eval-exclamation-mark, go back to Indicado.SMA module for more information.

Specs

eval!([list(), ...], pos_integer()) :: [float(), ...] | no_return()

Calculates SMA for the list. Raises exceptions when arguments does not satisfy needed conditions to calculate SMA.

Raises NotEnoughDataError if the given list is not longh enough for calculating SMA. Raises BadPeriodError if period is an unacceptable number.

Examples

iex> Indicado.SMA.eval!([1, 3, 5, 7], 2)
[2.0, 4.0, 6.0]

iex> Indicado.SMA.eval!([1, 3], 3)
** (NotEnoughDataError) not enough data

iex> Indicado.SMA.eval!([1, 3, 4], 0)
** (BadPeriodError) bad period