Docs

ta.ema

Follow price with an average that gives recent bars more weight than old ones.

itm
ta.ema(source, length)

Exponential moving average, alpha = 2/(length+1), seeded with the simple average of the first full window.

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.ema(close, 20)
itm
plot(ta.ema(close, 20), "Exponential 20")