BitMEX / api-connectors

Libraries for connecting to the BitMEX API.
https://www.bitmex.com/app/restAPI
910 stars 795 forks source link

BitMEX-Delta-Server : How to GET /trade/bucketed #384

Open PwnPeter opened 5 years ago

PwnPeter commented 5 years ago

Hello,

I would like to retrieve the ticker.

Given the data recovered via the bitmex-ws python api and the python-swagger api for bitmex are wrong (big timestamp shift, there are several open issues on this subject https://github.com/BitMEX/api-connectors/issues/139 https://github.com/BitMEX/api-connectors/issues/382 etc) I want to go through BitMEX-Delta-Server to recover the data. I want to get https://www.bitmex.com/api/explorer/#!/Trade/Trade_getBucketed , so I subscribed to the "trade" streams.

Success. Logging you in....
BitMEX-Delta-Server listening on http://localhost:5123
WebSocket[INFO]: Connected.
{"op": "subscribe", "args": "instrument:XBTUSD"}
{"op": "subscribe", "args": "orderBookL2:XBTUSD"}
{"op": "subscribe", "args": "quote:XBTUSD"}
{"op": "subscribe", "args": "trade:XBTUSD"}
{"op": "subscribe", "args": "quoteBin1m:XBTUSD"}

But when I try to recover the data : curl "http://localhost:5123/trade/bucketed?binSize=1m&partial=false&count=100&reverse=false" for example, I have this:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>GET Canoe /trade/bucketed</pre>
</body>
</html>

Anyone have a solution?

bretton commented 5 years ago

I'm interested in a reply on this topic too.

bretton commented 5 years ago

it sorta of seems to work if you add the following subscriptions to the deltaserver config.js, but only gives single results?

streams: ["tradeBin1m","tradeBin1h","tradeBin1d"]

then for hourly bucket on testnet delta server

curl -s "http://localhost:4443/tradeBin1h"