jrodriguez5909 / AlpacaTradingAlgo

A trading algorithm using Alpaca's API to buy oversold and sell overbought stocks & crypto assets
10 stars 17 forks source link

App not works with alpaca_py module #1

Open sramekmichal opened 8 months ago

sramekmichal commented 8 months ago

When I run app as you described in Readme, I will get error:

Traceback (most recent call last):
  File "AlpacaTradingAlgo/main.py", line 3, in <module>
    from trading_classes import *
  File "AlpacaTradingAlgo/trading_classes.py", line 4, in <module>
    import alpaca_py as tradeapi
ModuleNotFoundError: No module named 'alpaca_py'

I am sure, module exist and it is installed:

pip list -v          
Package                 Version      Location                                                                                                  Installer
----------------------- ------------ --------------------------------------------------------------------------------------------------------- ---------
alpaca-py               0.8.2       AlpacaTradingAlgo/venv/lib/python3.11/site-packages pip

I tried to switch the app to the previous alpaca-trade-api module:

# python main.py
• Grabbing technical metrics for 60 assets: 60it [00:09,  6.18it/s]
• Grabbing technical metrics for 1 assets: 1it [00:00,  5.10it/s]
• liquidated no positions based on the sell criteria
• executed no buy orders based on the buy criteria
jbaker425 commented 5 months ago

When I run app as you described in Readme, I will get error:

Traceback (most recent call last):
  File "AlpacaTradingAlgo/main.py", line 3, in <module>
    from trading_classes import *
  File "AlpacaTradingAlgo/trading_classes.py", line 4, in <module>
    import alpaca_py as tradeapi
ModuleNotFoundError: No module named 'alpaca_py'

I am sure, module exist and it is installed:

pip list -v          
Package                 Version      Location                                                                                                  Installer
----------------------- ------------ --------------------------------------------------------------------------------------------------------- ---------
alpaca-py               0.8.2       AlpacaTradingAlgo/venv/lib/python3.11/site-packages pip

I tried to switch the app to the previous alpaca-trade-api module:

# python main.py
• Grabbing technical metrics for 60 assets: 60it [00:09,  6.18it/s]
• Grabbing technical metrics for 1 assets: 1it [00:00,  5.10it/s]
• liquidated no positions based on the sell criteria
• executed no buy orders based on the buy criteria

Try replacing "alpaca_py" with "alpaca_trade_api". I think that's the current name for it now.