Skip to content

MA

Summary

Generic moving-average dispatcher that forwards the job to a concrete MA implementation selected by optInMAType. Single uniform interface over all TA-Lib moving averages.

Formula

outReal = MA_of_type(optInMAType)(inReal, optInTimePeriod); default type = SMA

Notes

  • A period of 1 performs no smoothing for every MAType: the output is a copy of the input.

Inputs

  • inReal — Series to average

Outputs

  • outReal — Selected moving average of the input

Parameters

  • optInTimePeriod — Averaging window length
  • optInMAType — Which moving-average algorithm to dispatch to

Implementation

TA-Lib Definition: ma.c · ma.yaml

Native File
C ta_MA.c
Rust ma.rs
Java Core.java

TA-Lib is also available for Python, R and more using a wrapper.

Aliases

Moving Average, MovingAverage

See Also

SMA · EMA · WMA · DEMA · TEMA · TRIMA · KAMA · MAMA · T3