Momentum-Trading-Example icon indicating copy to clipboard operation
Momentum-Trading-Example copied to clipboard

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

Open PravinrajV opened this issue 4 years ago • 3 comments

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'

PravinrajV avatar Mar 11 '20 03:03 PravinrajV

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

gucciwang avatar Mar 12 '20 05:03 gucciwang

Thank you. I will try this.

Regards, Pravinraj Vincent


From: Calvin Wang [email protected] Sent: Thursday, March 12, 2020 1:03:54 AM To: alpacahq/Momentum-Trading-Example [email protected] Cc: Pravinraj Vincent [email protected]; Author [email protected] 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.

PravinrajV avatar Mar 12 '20 12:03 PravinrajV

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

from ta.trend import macd

ljtruong avatar Apr 03 '20 02:04 ljtruong