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 Series of values to process.
length required series int Number of bars (length).

Return Type

series float

Example


          //@lipi=2
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)