Comments (6)
Hi @ITJusus
do check out the current example with the current code (I updated it over the past months). For Binance this is the API documentation:
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md
For openorders they give:
GET /api/v3/openOrders (HMAC SHA256)
So in VBA code that would be (make sure your api key is in Cred, like the examples in the file):
Dim ParamsT As New Dictionary
ParamsT.Add "timestamp", GetBinanceTime()
JsonResult = PrivateBinance("openOrders", "GET", Cred, ParamsT)
That should give you back your open orders.
Does that help?
Cheers,
Koen
from crypto_vba.
Yes, thank you. I'll give it a shot.
from crypto_vba.
Hello again. I'm trying to work my way through this, but I seem to be getting stuck.
When I run the following, I get a nice clean plethora of values between { }...
Debug.Print PrivateBinance("account", "GET", Cred, ParamsT)
When I run the openorders equivalent, I just get an empty [ ]...
Debug.Print PrivateBinance("openOrders", "GET", Cred, ParamsT)
Am I just not able to print an array and that's why this is happening? Or do you know if I'm doing something else wrong? I know I have 3 open orders currently. But it just comes back with [ ].
from crypto_vba.
Hi there,
okay, maybe the following helps:
-make sure the API key has the proper rights (might require trade permission)
-you could try "allOrders" instead, that requires a symbol
Dim ParamsT As New Dictionary
ParamsT.Add "timestamp", GetBinanceTime()
ParamsT.Add "symbol", "LTCBTC"
JsonResult = PrivateBinance("allOrders", "GET", Cred, ParamsT)
-try either "order" or "openOrders" with a symbol (all variations are in the Binance API docs)
The data that is returned is JSON, but it is also simply text, the next steps of the code transform that text into something that you can loop through etc. So a debug.print should give you the whole reply (no hidden parts of an array). Hope any of those options work?
from crypto_vba.
Thank you for the sage advice.
I was at least able to get some progress. When I add a specif symbol to the ParamsT and then utilize "allOrders"...I actually get results back.
Debug.Print PrivateBinance("allOrders", "GET", Cred, ParamsT)
Unfortunately, when I try the same, except changing "allOrders" to "openOrders"...it just returns [ ]. No data.
Debug.Print PrivateBinance("openOrders", "GET", Cred, ParamsT)
So, it's able to pull my order history (allOrders) but not my currently active orders (openOrders). Odd.
I did try replacing "openOrders" with "orders" and "order", but it just fails with the following error in either case...
{"error_nr":404,"error_txt":"HTTP-Not Found","response_txt":0}
I do have trading enabled in my api key. I've also been reading through the Binance API page and trying different options much of the day yesterday.
Problem with using "allOrders" is it pulls all active, cancelled, or filled orders...and only for 1 symbol. Since I really only want to know what orders (trades) I currently have open for any symbols...this would be much more difficult to use to try to grab only the data I need.
The "openOrders" would hit the spot, but it just doesn't seem to want to work. Crazy I can just replace "openOrders" with "allOrders" and I do get results. What does that isolate to be the problem then, is what I'm trying to figure out now.
from crypto_vba.
Hi there,
did you update the ModWeb module, as I improved the way the code processes the feedback the API gives?
I'm not actively using Binance, so have no orders nor coins to test, but these are my results:
allOrders: {"error_nr":400,"error_txt":"HTTP-Bad Request","response_txt":{"code":-1121,"msg":"Invalid symbol."}}
openOrders: []
order: {"error_nr":400,"error_txt":"HTTP-Bad Request","response_txt":{"code":-1102,"msg":"Mandatory parameter 'symbol' was not sent, was empty/null, or malformed."}}
That should help you finding out which parameters the API needs/expects. Otherwise you might want to ask around in their Telegram API group: https://t.me/binance_api_english
Cheers
from crypto_vba.
Related Issues (20)
- Deribit, FTX HOT 1
- C_ARR_OHLCV on FORMULAS sheet updates on every workbook change HOT 6
- Coinbase: View Transactions HOT 4
- Trojan:Script/Oneeva.A!ml Windows Defender HOT 3
- CoinbasePro all fills HOT 1
- Can you add Uphold? HOT 1
- Definition of some functions HOT 4
- Error in Sub TestBitVavo() HOT 2
- How to Get Binance Withdraw History? HOT 3
- Add Celsius Wallet
- Place Buy/Sell order? HOT 7
- Woo x HOT 1
- Binance and OKEx errors. HOT 1
- coinbase error HOT 1
- Virus included in the download HOT 1
- how to add new crypto currencies (coinbase) HOT 1
- Cannot get Binance and Coinbase Pro to work in example sheet HOT 2
- can't download HOT 4
- Kucoin Api V2 HOT 1
- Kraken Api, place order HOT 1
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 crypto_vba.