Lipi Reference Lipi

Functions

talib.ema()

Exponential moving average of `source` over `length` bars, weighted so that recent bars count for more than older ones. It takes the same two arguments as `talib.sma`, so swapping one for the other is a one-word change.

Syntax

                talib.ema(series float source, series int length) → series float
              

Arguments

source required series float The series to average.
length required series int How many bars the average covers.

Return Type

series float

Example


          indicator("EMA Example", overlay=true)
// Define input source and period
src = close
length = 20
// Compute EMA
ema_line = talib.ema(src, length)
// Plot the EMA
plot(ema_line, title="EMA 20", color=color.blue)