How can I post an order request via API?
2 Kommentare
Antworten (1)
Hi Fabio,
Without a pair of keys myself I cannot duplicate the auth portion of this. I suspect this woudl be done with the username and password inputs of weboption For the remainder, all of the API is just using GET and POST methods. These can be accomplished with the webread function. As an example consider the API interface for returning the candles info (GET method):
r = webread('https://api.hitbtc.com/api/2/public/orderbook/ETHBTC','limit',200,'period','M1')
The above returns a structure with the 1 minute interval high, low, open, close, etc. for the ETHBTC pair. As you can see each of the fields is a different input to the webread command. The webread command defaults to GET method, whereas the webwrite function uses POST method, although there are option sin the weboptions as well. Again, without the keys I cannot exactly produce the desired resutls, but you should have something similar to:
r = webwrite('https://api.hitbtc.com/api/2/order',... 'symbol','ethbtc',... 'side','sell',... 'quantity', 0.063,... 'type','market',... 'timeInForce','GTC')
0 Kommentare
Siehe auch
Kategorien
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!