Skip to main content

sma

Gets simple moving average (SMA) for stock

Source Code: [link]

openbb.ta.sma(data: pd.Series, length: int = 50, offset: int = 0)

Parameters

NameTypeDescriptionDefaultOptional
datapd.SeriesDataframe of dates and pricesNoneFalse
lengthintLength of SMA window50True
offsetintLength of offset0True

Returns

TypeDescription
pd.DataFrameDataframe containing prices and SMA