sma#

sma(close, length=None, talib=None, offset=None, **kwargs)[source]#

Simple Moving Average (SMA)

The Simple Moving Average is the classic moving average that is the equally weighted average over n periods.

Sources:

https://www.tradingtechnologies.com/help/x-study/technical-indicator-definitions/simple-moving-average-sma/

Calculation:
Default Inputs:

length=10

SMA = SUM(close, length) / length

Args:

close (pd.Series): Series of ‘close’s length (int): It’s period. Default: 10 talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib

version. Default: True

offset (int): How many periods to offset the result. Default: 0

Kwargs:

adjust (bool): Default: True presma (bool, optional): If True, uses SMA for initial value. fillna (value, optional): pd.DataFrame.fillna(value) fill_method (value, optional): Type of fill method

Returns:

pd.Series: New feature generated.