51bitquant / binance_grid_trader

Binance_grid_trader is a grid strategy bot trading with Binance Spot and Binance Futures Exchange. you can use it to trade any pair in Binance Exchange. Binance_grid_trader是一个币安网格策略软件, 目前支持币安现货,USDT合约和币币合约。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid API key

didikrm opened this issue · comments

I have created a testing account on Binance and I am getting this message

error {'code': -2015, 'msg': 'Invalid API-key, IP, or permissions for action.'} 401.
Does it mean that the programme can only be used with 'real' account or has Binance change their requirements? Anyone tested it recently.

Thanks in advance

you need to regenerate your api-key without restriction of ip. Remember to select the future box if you want to trade perpetual future.

Thanks for the suggestion. Looking at the code, I noticed that you develop everything from the beginning instead of using Binance API which would be a more standard approach.

Actually, I was using the testnet API rather than the real one. Anyhow, I managed to change the hostname in the code and it seems to be working. However, I am getting the following errors:

请求:/api/v3/openOrders, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/openOrders, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/openOrders, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/openOrders, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/openOrders, 发生了错误: Expecting value: line 1 column 1 (char 0)
cancel orders: None
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
bid_price: 0, ask_price: 0
buy orders: []
------------------------------
sell orders: []
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
bid_price: 0, ask_price: 0

I was using the default config settings:

{
"platform": "binance_spot",
"symbol": "BTCUSDT",
"api_key": "XXX",
"api_secret": "XXX",
"gap_percent": 0.001,
"quantity": 0.001,
"min_price": 0.01,
"min_qty": 0.001,
"max_orders": 1,
"proxy_host": "",
"proxy_port": 0
}

It could be that Binance has changed its APIs, so it does not accept orders any more?

Thanks
Didi

Thanks for the suggestion. Looking at the code, I noticed that you develop everything from the beginning instead of using Binance API which would be a more standard approach.

Actually, I was using the testnet API rather than the real one. Anyhow, I managed to change the hostname in the code and it seems to be working. However, I am getting the following errors:

请求:/api/v3/openOrders, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/openOrders, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/openOrders, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/openOrders, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/openOrders, 发生了错误: Expecting value: line 1 column 1 (char 0)
cancel orders: None
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
bid_price: 0, ask_price: 0
buy orders: []
------------------------------
sell orders: []
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
请求:/api/v3/ticker/bookTicker, 发生了错误: Expecting value: line 1 column 1 (char 0)
bid_price: 0, ask_price: 0

I was using the default config settings:

{
"platform": "binance_spot",
"symbol": "BTCUSDT",
"api_key": "XXX",
"api_secret": "XXX",
"gap_percent": 0.001,
"quantity": 0.001,
"min_price": 0.01,
"min_qty": 0.001,
"max_orders": 1,
"proxy_host": "",
"proxy_port": 0
}

It could be that Binance has changed its APIs, so it does not accept orders any more?

Thanks
Didi

Why not use the real one, the testing network maybe not working for some expected reasons. Using the real one does not cost too much. You just need to deposit only 20USDT or less than 100USDT will work.