alpacahq / Momentum-Trading-Example

An example algorithm for a momentum-based day trading strategy.
657 stars 218 forks source link

from ta import macd ImportError: cannot import name 'macd' #13

Open PravinrajV opened 4 years ago

PravinrajV commented 4 years ago

I followed the instructions and I get the below error when running the algo.py:

pravinraj_vincent@alpaca-uirobots:~$ python3 algo.py Traceback (most recent call last): File "algo.py", line 4, in from ta import macd ImportError: cannot import name 'macd'

gucciwang commented 4 years ago

You can fix that by downgrading your ta package to the time when they published this demo. The following should work for you:

pip uninstall ta
pip install ta==0.4.5
PravinrajV commented 4 years ago

Thank you. I will try this.

Regards, Pravinraj Vincent


From: Calvin Wang notifications@github.com Sent: Thursday, March 12, 2020 1:03:54 AM To: alpacahq/Momentum-Trading-Example Momentum-Trading-Example@noreply.github.com Cc: Pravinraj Vincent pravinraj.vincent@gmail.com; Author author@noreply.github.com Subject: Re: [alpacahq/Momentum-Trading-Example] from ta import macd ImportError: cannot import name 'macd' (#13)

You can fix that by downgrading your ta package to the time when they published this demo. The following should work for you:

pip uninstall ta pip install ta==0.4.5

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/alpacahq/Momentum-Trading-Example/issues/13#issuecomment-598008325, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHQ6NVIYSYANRABKIJVZYQ3RHBULVANCNFSM4LFMUDOA.

ljtruong commented 4 years ago

the macd trend indicator has been moved to ta.trend class

from ta.trend import macd