Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status:active but still "Failed to authneticate" #9

Open
gilbh opened this issue Dec 23, 2020 · 0 comments
Open

status:active but still "Failed to authneticate" #9

gilbh opened this issue Dec 23, 2020 · 0 comments

Comments

@gilbh
Copy link

gilbh commented Dec 23, 2020

I really like your scalping strategy and Python implementation!

I have a live account and a paper account, and regularly work with Polygon. However, when I try to run your code with my paper account, I get the following error:

c:\users\gil\envs\utils\lib\site-packages\alpaca_trade_api\stream2.py in _connect(self)
     44             status = msg.get('data').get('status')
     45             if status != 'authorized':
---> 46                 raise ValueError(
     47                     (f"Invalid Alpaca API credentials, Failed to "
     48                      f"authenticate: {msg}")

ValueError: Invalid Alpaca API credentials, Failed to authenticate: {'stream': 'authorization', 'data': {'action': 'authenticate', 'message': 'access key verification failed', 'status': 'unauthorized'}}

-- this is despite the fact my account is active:

ipdb> api.get_account()
Account({   'account_blocked': False,
    'account_number': 'PA28K7UTZQSB',
    'buying_power': '160000',
    'cash': '40000',
    'created_at': '2020-12-23T01:29:09.496085Z',
    'currency': 'USD',
    'daytrade_count': 0,
    'daytrading_buying_power': '160000',
    'equity': '40000',
    'id': 'e3d0cd29-078a-484e-856b-6819912ca25d',
    'initial_margin': '0',
    'last_equity': '40000',
    'last_maintenance_margin': '0',
    'long_market_value': '0',
    'maintenance_margin': '0',
    'multiplier': '4',
    'pattern_day_trader': False,
    'portfolio_value': '40000',
    'regt_buying_power': '80000',
    'short_market_value': '0',
    'shorting_enabled': True,
    'sma': '0',
    'status': 'ACTIVE',
    'trade_suspended_by_user': False,
    'trading_blocked': False,
    'transfers_blocked': False})

Can you please advise?

Thanks,
Gil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant