krijnsent/crypto_vba

Binance giving generic authentication errors on anything relating to test orders

binancetester opened this issue · 4 comments

Hello,
Great job with this.
The VBA code, "Test a test order" and "Delete a non-existing order" both come back with {"error_nr":401,"error_txt":"HTTP-Unauthorized","response_txt":{"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}}.

Is this because, despite it being a test order, the account is yet to be verified?
Thanks heaps!!

Hi there,
that does sound like you didn't set the trade permission on your API-key. So please do check your API-key at the Binance site and check that the trade checkbox is checked. Does that do the trick?
Koen

Hi krijnsent.

It would be great if you could also add a comment line in Function PublicBinance() and PrivateBinance() to show a sample parameters to call that function properly. For example to see the current positions in the portfolio. Thank you

updates:
TestResult = PrivateBinance("account", "GET", Cred, Params2) only return part of the portfolio position as follow:
"{"makerCommission":10,"takerCommission":10,"buyerCommission":0,"sellerCommission":0,"canTrade":true,"canWithdraw":true,"canDeposit":true,"updateTime":1613356490895,"accountType":"SPOT","balances":[{"asset":"BTC","free":"0.01203670","locked":"0.000000

Please help when free. Thank you

For samples: please see the Test Sub that is at the top of the Binance module, it has quite some examples. Secondly: check out the excel file in this repository, it provides some examples too and also how to get it to a spreadsheet. If you want case specific examples or code, that's not the purpose of this repository, sorry.

Rayzola, if I understand what you want, use this easy solution to get a specific data like your BNB total in spot:
Total_BNB = Mid(ResulFromExchange, InStr(ResulFromExchange, "BNB") + 13, 10)
The function gives you all the data sent by the exchange, we have to code our solution to get specific information.