bmoscon / cryptofeed

Cryptocurrency Exchange Websocket Data Feed Handler
Other
2.19k stars 679 forks source link

Bitmex: implement pair normalization #361

Closed yohplala closed 3 years ago

yohplala commented 3 years ago

Feature request Implement pair normalization for Bitmex as well. Possibly, make both possible: legacy pair naming and pair normalization? (for those willing to keep legacy pair naming)

Additional context I am using a script to generate config file, at least the part concerning exchanges. I basically list:

bmoscon commented 3 years ago

each exchange has a generate pairs method, even bitmex - why doesnt your strategy work?

yohplala commented 3 years ago

Hi @bmoscon , Sorry, the ticket is possibly not very clear. Pair normalization is not implemented for Bitmex. For instance, to query BTC-USD to Bitmex, you need to write XBTUSD in the config file. In this sense, my strategy fails because it only generate pairs in the form base_coin-quote-coin. Bests

bmoscon commented 3 years ago

ok, makes sense. its probably time to bring bitmex into the normalized pair fold :)

yohplala commented 3 years ago

Hit @bmoscon, hi @olibre I am sorry, i just checked PR #363, and from what I could not find in this PR, I just confirm it does not implement it.

 from cryptofeed.exchanges import Bitmex
Bitmex.info()['pairs']

Results

['LINKUSDTZ20',
 'XTZUSDTZ20',
 'BNBUSDTZ20',
 'ADAUSDTZ20',
 'EOSUSDTZ20',
 'YFIUSDTZ20',
 'DOTUSDTZ20',
 'XRPZ20',
 'BCHZ20',
 'ADAZ20',
 'EOSZ20',
 'TRXZ20',
 'LINKUSDTH21',
 'XTZUSDTH21',
 'BNBUSDTH21',
 'ADAUSDTH21',
 'EOSUSDTH21',
 'YFIUSDTH21',
 'DOTUSDTH21',
 'XRPH21',
 'BCHH21',
 'ADAH21',
 'EOSH21',
 'TRXH21',
 'XRPUSD',
 'LINKUSDT',
 'BCHUSD',
 'XBTUSD',
 'XBTZ20',
 'XBTH21',
 'XBTM21',
 'ETHUSD',
 'ETHZ20',
 'ETHUSDZ20',
 'ETHH21',
 'ETHUSDH21',
 'LTCUSD',
 'LTCZ20',
 'LTCH21']

Normalized paris should read (proposing to use _ to further split contract end for futures, similar to Binance)

['LINK-USDT_Z20',
 'XTZ-USDT_Z20',
 'BNB-USDT_Z20',
 'ADA-USDT_Z20',
 'EOS-USDT_Z20',
 'YFI-USDT_Z20',
 'DOT-USDT_Z20',
 'XRP_Z20',
 'BCH_Z20',
 'ADA_Z20',
 'EOS_Z20',
 'TRX_Z20',
 'LINK-USDT_H21',
 'XTZ-USDT_H21',
 'BNB-USDT_H21',
 'ADA-USDT_H21',
 'EOS-USDT_H21',
 'YFI-USDT_H21',
 'DOT-USDT_H21',
 'XRP_H21',
 'BCH_H21',
 'ADA_H21',
 'EOS_H21',
 'TRX_H21',
 'XRP-USD',
 'LINK-USDT',
 'BCH-USD',
 'BTC-USD',    # notice here BTC instead of XBT
 'BTC_Z20',       # same
 'BTC_H21',       # same
 'BTC_M21',       # same
 'ETH-USD',
 'ETH_Z20',
 'ETH-USD_Z20',
 'ETH_H21',
 'ETH-USD_H21',
 'LTC-USD',
 'LTC_Z20',
 'LTC_H21']
yohplala commented 3 years ago

@bmoscon could you re-open this ticket please?

bmoscon commented 3 years ago

yes, i closed the wrong one

bmoscon commented 3 years ago

The other PR was misnamed I believe, it fixed the bitfinex issue, not the bitmex issue

yohplala commented 3 years ago

The other PR was misnamed I believe, it fixed the bitfinex issue, not the bitmex issue

Hmm, I had a look: there have been some new lines for BitmAx when before there was nearly none. So yes, I think it is misnaming, but Bitmax instead of Bitmex :+1:

Thanks Bryant

olibre commented 3 years ago

Sorry guys. The bug is in my brain: confused the names Bit[m]ex and Bit[fin]ex. :open_mouth:

bmoscon commented 3 years ago

done