Skip to content

Macd bug #3

Description

@AiAzez

I keep getting error from macd:
def compute_macd(close):
macd = pandas_ta.macd(close=close, length=20).iloc[:,0]
return macd.sub(macd.mean()).div(macd.std())

df['macd'] = df.groupby(level=1, group_keys=False)['adj close'].apply(compute_macd)


TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'

result = self._python_apply_general(f, self._selected_obj)
values, mutated = self._grouper.apply_groupwise(f, data, self.axis)
res = f(group)
return op(a, b)

what is the solution

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions