Comments (16)
By default, this connects to the Testnet exchange. Are you sure you created a Testnet key?
from sample-market-maker.
@STRML : yes I did. but does the
API_KEY
setting is the api key given nameβ―?
No, you need to put in the ID.
from sample-market-maker.
@bendelo @STRML I'm getting the same error even with a valid ID (and key) from Testnet.
from sample-market-maker.
did anyone work this one out?
from sample-market-maker.
For anyone else running into this problem, I was able to run it properly outside a virtualenv.
from sample-market-maker.
I had the same problem. Be sure you copy the ID and Secret right (the input bar gets all auto-selected itself when you click inside it. No need to use CTRL+A! After that you need to use only CTRL+C and CTRL+V). Hope it helps. Works also in virtual environment and Python 3.
from sample-market-maker.
That is the error message returned when an invalid API key is entered in settings.py
.
It should work in both Python3 and in a virtual environment. Absent any other information, this looks like an incorrect API key. Closing.
from sample-market-maker.
I have the same issue, running Python 3.6 on Windows 10.
2018-04-11 11:40:29,709 - INFO - ws_thread - Connecting to wss://testnet.bitmex.com/realtime?subscribe=quote:XBTUSD,trade:XBTUSD,instrument,order:XBTUSD,execution:XBTUSD,margin,position
2018-04-11 11:40:29,709 - INFO - ws_thread - Authenticating with API Key.
2018-04-11 11:40:29,710 - INFO - ws_thread - Started thread
2018-04-11 11:40:30,436 - ERROR - ws_thread - Handshake status 400 Bad Request
2018-04-11 11:40:30,711 - ERROR - ws_thread - Couldn't connect to WS! Exiting.
I know for a fact that my test bitmex API/Secret in the settings.py file are correct. This pair works in other API targeting the test environment in Bitmex. Also, when I replace the API key with something else, I get a different error, so I am certain the API Key/Secret is not the issue here:
2018-04-11 11:46:34,167 - ERROR - ws_thread - API Key incorrect, please check and restart.
Please help.
from sample-market-maker.
That error message corresponds to a 401 Not Authorized
response - meaning the credentials were recognized, but not valid. If you create a new API key and use that, do you see the same error?
from sample-market-maker.
wow - creating a new api key worked perfectly. I guess the nonce was too small compared to a prior larger nonce that was sent. Thanks for your help.
(ccxt/ccxt#147) "Basically, Bitmex is telling you, that your keys have already been used with a bigger nonce previously. So you need an even bigger one. By default the nonce is 32 bit (1503497932) and the last nonce you used with bitmex was 1502567277932. To fix it, use a fresh new keypair, or if you want to continue with this keypair, override the nonce for milliseconds or microseconds, as in the Manual."
from sample-market-maker.
Everything worked just fine in testnet.bitmex.com, but I went to fetch a brand new fresh api key/secret pair for the live environment, using the same setting.py, but changing the target to BASE_URL = "https://www.bitmex.com/api/v1/" and using the correct new api key/secret, and I'm back to the "ERROR - ws_thread - Handshake status 401 Unauthorized" issue again for test. I switch back to testnet, and it works just fine. Any thoughts as to why production would not work? Since I have a fresh api key, I don't think it's a nonce issue again, like last time above where the fresh api key solved the 400 and 401 errors.
from sample-market-maker.
I made an error in my live environment settings file (commenting/uncommenting); and now after fixing, everything works. So this solution of a new api key worked for both test and live environments. Problems solved.
from sample-market-maker.
I am receiving a 401 error on every key i try. I have created over 10 api keys and they all return 401 error on the test net. Any one comming across the same issue? Any help would be appreciated. thanks
from sample-market-maker.
Make sure the API key was created with sufficient permissions: https://testnet.bitmex.com/app/apiKeysUsage#API-Key-Permissions
from sample-market-maker.
Getting unautorized as well, what's the key pair for ID and Secret in the POST request? (I'm using matlab)
apiKey? ID? api-key? Can't find it anywhere
from sample-market-maker.
@erny0024 read the documentation:
https://testnet.bitmex.com/app/apiKeysUsage#Authenticating-with-an-API-Key
from sample-market-maker.
Related Issues (20)
- ERROR - ws_thread - API Key incorrect, please check and restart.
- How to set start_position equal to current open position?
- Unable to link WS HOT 1
- cannot execute
- old filter? HOT 1
- Usability after nov. 23, no more bulk orders HOT 3
- bulk order endpoint issue after last commit HOT 3
- How can I make this bot to open the Long only or Short only trades on one side instead of both sides
- Cannot Import name "BITMEX" from Partially initialized module 'market_maker' HOT 1
- How to run markermaker setup?
- Sample market-maker stopping at "Connected to WS. Waiting for data images, this may take a moment..." HOT 1
- Cant get bot to make live (test net) orders HOT 1
- __on_error() takes 2 positional arguments but 3 were given
- The implementation is outdated does not work with the current BitMex API HOT 1
- KeyError: 'clOrdID' HOT 1
- ws_thread.py funds can return wrong currency
- Versions after 1.5.0 can't be edited. HOT 1
- Websocket error "can only concatenate str (not "int") to str" HOT 4
- NameError: global name 'FileExistsError' is not defined HOT 1
- Error while connecting with websocket
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sample-market-maker.