mirror of
https://github.com/wassname/pandas-ta.git
synced 2026-09-10 12:23:49 +08:00
@@ -15,6 +15,12 @@ def sma(close, length=None, offset=None, **kwargs):
|
||||
# Offset
|
||||
if offset != 0:
|
||||
sma = sma.shift(offset)
|
||||
|
||||
# Handle fills
|
||||
if 'fillna' in kwargs:
|
||||
sma.fillna(kwargs['fillna'], inplace=True)
|
||||
if 'fill_method' in kwargs:
|
||||
sma.fillna(method=kwargs['fill_method'], inplace=True)
|
||||
|
||||
# Name & Category
|
||||
sma.name = f"SMA_{length}"
|
||||
@@ -51,4 +57,4 @@ Kwargs:
|
||||
|
||||
Returns:
|
||||
pd.Series: New feature generated.
|
||||
"""
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user