Functions
talib.sma()
Simple moving average of `source` over `length` bars: every bar in the window counts for the same. Reach for this one unless you want a particular weighting, in which case see `talib.ema`, `talib.wma` or `talib.vwma`.
Syntax
talib.sma(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("Simple Moving Average (SMA)", overlay=true)
length = input(20, "SMA Length")
smaValue = talib.sma(close, length)
plot(smaValue, color=color.blue, title="SMA")