Questions about BitMEX products and APIs. BitMex is a P2P crypto-products trading platform.
Questions tagged [bitmex]
30 questions
1
vote
1 answer
Get value from json - API
So I have an API conection established in python, everything is alright.
My question is how to get to the value of 'avgEntryPrice'?
[{'account': 231584,'simpleCost': 0.0, 'simpleValue': 0.0, 'avgEntryPrice': 0.0, ...}]
this is returned…

Wiktor Kisielewski
- 407
- 4
- 17
1
vote
3 answers
ImportError: cannot import name 'WebSocketApp' from 'websocket' (/Users/raphaelhen/Desktop/websocket.py)
I am new here, and in programing. until toady I got all my answer here, but I was not able to find id this time so this is my code
from bitmex_websocket import BitMEXWebsocket
ws =…

Raphael Hen
- 83
- 1
- 6
0
votes
0 answers
How to change API request call to fetch?
I am practicing how to use the bitmex api.
It is an API endpoint that gets position information. It works when request is used, but it does not work when fetch is used. What's wrong with this? The code is the same, but I get an authentication…

bamgae
- 301
- 1
- 2
- 15
0
votes
2 answers
RestAPI filter params JSON
I'm trying to get the last data from the bitmex API
Base URI: https://www.bitmex.com/api/v1
I don't really understand how to get the last data (from today) using filters : https://www.bitmex.com/app/restAPI
here is my code:
from datetime import…

Jordan
- 7
- 3
0
votes
1 answer
BITMEX Websocket connection drops / disconnects despite keep alive burning through connection pool
Every once in a while Bitmex disconnects our websocket connection which forces us to reconnect. However, they provide a connection pool of 40 connections per hour. In times of low volatility it seems not to be a problem AT ALL, however as soon as…

Dribel
- 465
- 1
- 10
- 24
0
votes
1 answer
BITMEX API - Cancel Order by given Symbol - How to do in Dart Language?
I try to send a cancel order request with formData that only given orders symbol. But unfortunatly all other orders removes from exchange too..
It seems the formData that i added to request does not work.
In Dart Language, Does any one has…

ASIAMINOR
- 96
- 1
- 5
0
votes
1 answer
How to receive real time data through Bitmex Websocket Api on python?
I understand that I can use "while true" and call the 'get_ticker' method to get the last price of the product, but this drives from python instead of the market itself. I was wondering if there is a way to get the last price as BitMEX's website…

gnvsdnvjds
- 21
- 2
0
votes
0 answers
Resubscribe to the websocket channel using setTimeout
I have written a code in vue.js which creates a websocket connection and subscribe to a channel to get the data of BTC in USD.
But that channel one sends the updated data of size for some prices but I need a way to resubscribe to the channel to get…

Engr Umair
- 130
- 10
0
votes
0 answers
BitMEX API cant connect due to "Exception thrown: 'System.Net.WebException' in System.dll"
I am trying to make a bot for BitMEX using the official api connector provided by bitmex
https://github.com/BitMEX/api-connectors
But when trying to connect, it says in the output "Exception thrown: 'System.Net.WebException' in System.dll"
Does…
0
votes
1 answer
{error={name=HTTPError, message=Signature not valid.}} Bitmex Api connection error
I've been trying to the best of my capability to interprete bitmex's indications for api connection, but this is all I get:
function balanceBitmex() {
var apiKey = '***';
var apiSecret = '***';
var verb = 'get';
var path =…

John Galassi
- 309
- 2
- 16
0
votes
1 answer
What is the best way to repeatedly execute a function in Python?
I am trying to pull some data from a website. The issue I am having is that it pulls the data value and then goes on to just reprint it continuously rather than pull the most recent live data value and update that. I got the code from…

Gurcharan Sehmbi
- 13
- 3
0
votes
1 answer
TypeError: can only concatenate str (not "list") to str
when i try the following line of code
print(self.exchange3.privateGetPosition([{'currentQty'}]))
i get the the following error
File "c:/Users/User2/sample_market_maker/SAMPLE/botv2.py", line 130, in…

Varun Reddy
- 31
- 2
- 5
0
votes
0 answers
TypeError: Object of type set is not JSON serializable
When I try running this line in python, using the Bitmex Rest API
qty2 = self.client.Position.Position_get(json.dumps({'symbol': 'XBTUSD'}),json.dumps({'currentQty'})).result()
I get this error
File…

Varun Reddy
- 31
- 2
- 5
0
votes
2 answers
Python: E1136:Value 'self.exchange.get_portfolio' is unsubscriptable
def get_portfolio(self):
contracts = settings.CONTRACTS
portfolio = {}
for symbol in contracts:
position = self.bitmex.position(symbol=symbol)
instrument = self.bitmex.instrument(symbol=symbol)
…

Varun Reddy
- 31
- 2
- 5
-1
votes
1 answer
Error message: Function is not callable, not sure what is wrong?
def smaShort(self):
while True:
ohlcv_candles = bitmex2.bitmex.fetch_ohlcv(self, symbol= 'XBTUSD', timeframe= '5m')
mas = []
mas = ohlcv_candles.rolling(window=5).mean()
return mas#[-1]
when trying to call smaShort…

Varun Reddy
- 31
- 2
- 5