Hi,
Thank's for your great project. I am using the demo account. My api and secret key is provided by someone else. When I use the simple code in the demo, I get the following error.
Traceback (most recent call last):
File "C:\Users\UserName\Desktop\python\bintest.py", line 16, in <module>
quantity=100)
File "C:\Users\UserName\AppData\Local\Programs\Python\Python36-32\lib\site-packages\binance\client.py", line 858, in create_order
return self._post('order', True, data=params)
File "C:\Users\UserName\AppData\Local\Programs\Python\Python36-32\lib\site-packages\binance\client.py", line 189, in _post
return self._request_api('post', path, signed, version, **kwargs)
File "C:\Users\UserName\AppData\Local\Programs\Python\Python36-32\lib\site-packages\binance\client.py", line 160, in _request_api
return self._request(method, uri, signed, **kwargs)
File "C:\Users\UserName\AppData\Local\Programs\Python\Python36-32\lib\site-packages\binance\client.py", line 155, in _request
return self._handle_response(response)
File "C:\Users\UserName\AppData\Local\Programs\Python\Python36-32\lib\site-packages\binance\client.py", line 179, in _handle_response
raise BinanceAPIException(response)
binance.exceptions.BinanceAPIException: APIError(code=-2010): Account has insufficient balance for requested action.
Thank's :)
Hi Hujjat,
I haven't used this project but I had a similar error message with another python exchange wrapper. The problem was in the end that I was reading my funds from the exchange and save it in a variable to use it later in a buy operation. But through data type conversion I got more decimal points than supportet. I had to write a rounding function to get it back to the maximum digits allowed (in my case Satoshi units "one hundred millionth of a single bitcoin") and then it worked again. I never had insufficient funds but my request wasn't supported.
Maybe this will help you.
Cheers
Philip
Hi @Hujjat the example code is just that, an example of how you may use the wrapper.
If you look at the create order example you have copied it's attempting to buy 100 BNB with BTC. You don't have enough BTC on your account to purchase this much so you receive the "Account has insufficient balance for requested action" error from Binance.
What I will do is change the example to create_test_order function so no one else copies and pastes and makes the same mistake.
@sammchardy @philschw thanks. 馃憤
Most helpful comment
Hi Hujjat,
I haven't used this project but I had a similar error message with another python exchange wrapper. The problem was in the end that I was reading my funds from the exchange and save it in a variable to use it later in a buy operation. But through data type conversion I got more decimal points than supportet. I had to write a rounding function to get it back to the maximum digits allowed (in my case Satoshi units "one hundred millionth of a single bitcoin") and then it worked again. I never had insufficient funds but my request wasn't supported.
Maybe this will help you.
Cheers
Philip