Cumulative Moving Average - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

The cumulative moving average, also known as the running average, is calculated by adding all of the data points up to a certain point in time and dividing by the number of data points. The formula for calculating a cumulative moving average is:

CMA = (Sum of data points up to a specific point in time) / (Number of data points up to that point in time)

For example, the cumulative moving average of a stock's closing price on day 20 would be calculated by adding the closing prices of days 1 through 20 and dividing by 20.

With MAvgType ('C'), the MovingAverage function computes the arithmetic average of all the rows from the beginning of the series with this formula:

CMA = (V1 + V2 + ... + VN)/N

Vi is a value. N is the number of rows from the beginning of the data set.