Merge pull request #60 from lambdaclass/fix-sma-calculation

fixed sma calculation
This commit is contained in:
Javier Rodríguez Chatruc
2020-03-18 14:57:16 -03:00
committed by GitHub
+1 -1
View File
@@ -81,6 +81,6 @@ class TiingoData:
def sma(self, periods):
sma = self._data.groupby('symbol', as_index=False).rolling(periods)['adjClose'].mean()
sma = sma.fillna(0)
sma.index = sma.index.levels[1]
sma.index = [index[1] for index in sma.index]
self._data['sma'] = sma
self.schema.update({'sma': 'sma'})