We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
I'm trying for the first time you Python IG Market API code with a demo account but it raises
{"accountType":"CFD","accountInfo":{"balance":30000.0,"deposit":0.0,"profitLoss":0.0,"available":30000.0},"currencyIsoCode":"EUR","currencySymbol":"E","currentAccountId":"HIDDEN_DATA","lightstreamerEndpoint":"https://demo-apd.marketdatasystems.com","accounts":[{"accountId":"HIDDEN_DATA","accountName":"Demo-CFD","preferred":true,"accountType":"CFD"}],"clientId":"HIDDEN_DATA","timezoneOffset":1,"hasActiveDemoAccounts":true,"hasActiveLiveAccounts":true,"trailingStopsEnabled":false,"reroutingEnvironment":null,"dealingEnabled":true} Traceback (most recent call last): File "main.py", line 10, in <module> account_info = ig_service.switch_account('HIDDEN_DATA', False) File "/Users/femto/fx/femtoprojects/python/ig_markets/ig-markets-rest-api-python-library/ig_service.py", line 371, in switch_account self.set_headers(response.headers, False) File "/Users/femto/fx/femtoprojects/python/ig_markets/ig-markets-rest-api-python-library/ig_service.py", line 421, in set_headers self.SECURITY_TOKEN = response_headers['X-SECURITY-TOKEN'] File "/Users/femto/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/requests/structures.py", line 54, in __getitem__ return self._store[key.lower()][1] KeyError: 'x-security-token'
I did this
try: self.SECURITY_TOKEN = response_headers['X-SECURITY-TOKEN'] except: self.SECURITY_TOKEN = None
to fix it
But I don't know if that's risky.
Kind regards
Femto
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I'm trying for the first time you Python IG Market API code with a demo account but it raises
I did this
to fix it
But I don't know if that's risky.
Kind regards
Femto
The text was updated successfully, but these errors were encountered: