Docs

ta.wma

Smooth a series with linearly rising weights so the newest bar counts most.

itm
ta.wma(source, length)

Weighted moving average with linearly increasing weights 1..length.

Parameters

A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.

NameKindTypeDefaultRangeDescription
sourceSeriesnumber--The series to read.
lengthConstantnumber-1 to 10000Window in observed bars.

Output

NameType
valuenumber

Warm-up and missing values

Warm-up
length bars. Names in the warm-up are this operator’s parameters.
Missing values
Returns na until length consecutive non-na observations are in the window. An na resets the accumulation.

Example

itm
ta.wma(close, 20)
itm
plot(ta.wma(close, 20), "Weighted 20")