-
Notifications
You must be signed in to change notification settings - Fork 199
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
Exception: error.security.account-token-invalid #328
Comments
It's working perfectly for me. Is you account Spreadbet or CFD? I'm only working with Spreadbet. I send a lot more parameters, so perhaps you need to add some more such as size, stop_level... Here's a snippet from my code...
|
Thank you for your reply @galburn I've try the following code and it works resp = ig_service.create_open_position( But it looks like if I change it to 'SELL', the error comes back again? |
I'll repeat my question. Is you account Spreadbet or CFD? This looks to be a code or account issue, not a bug in the library. Please provide a complete minimal example that demonstrates the issue. |
The account I'm testing on is Spreadbet. It works fine if I space out the requests for at least 1 minute. Is that normal? This is one of the codes
|
Well that code runs perfectly without error for me! Even if I remove all the hashes. If you need further help, please take a look here... It may well be that your library imports or versions are causing a problem. Or there is some other code mistake. This is why we insist upon a complete minimal example. |
It works fine on the first request but the second one showed the error until I waited a minute, and it worked fine again. Does that mean there's a limit to how many requests we can put within a 1 minute period? Many thanks |
There are API limits, but you should not be hitting them with one request per minute. I have no trouble sending one immediately after another. |
Greetings World!
I was testing my simple code:
buy = ig_service.create_open_position(epic='IX.D.DAX.DAILY.IP', direction='BUY') print(buy)
and the error appeared:
Exception: error.security.account-token-invalid
My requests using ig_service.fetch_open_positions() and ig_service.fetch_accounts() worked fine so I don't think the token is the problem?
Or am I wrong gentlemen?
Any guidance is much appreciated.
Kind regards
The text was updated successfully, but these errors were encountered: