BitMEX Adapter

The incubator of Bookmap adapter(s) to BitMEX exchange. May contain number of ongoing projects
Post Reply
AndreyR
Posts: 2
Joined: Mon Jul 09, 2018 11:18 am

BitMEX Adapter

Post by AndreyR » Wed Jul 11, 2018 11:38 am

For general instructions on how to install and use external adapters under Bookmap Connect solution, please read here: https://bookmap.com/wiki/Bookmap_API#Bo ... t_solution

Why BitMEX

Before you register an account ;) If you wish to contribute to the developers, please use following affiliate link to register an account on BitMEX: https://www.bitmex.com/register/2rg2pY
This will not affect your own fees. It's a regular affiliate link that BitMEX assigns to any trading account including yours. Read more about it here.

It's easy to find on internet pros/cons of BitMEX exchange and comparison to other exchanges. Here are some of its pros:
  • Ability to open a trading account within minutes regardless of your country of residence (probably because it accepts only digital currency and therefore has to comply with less regulations)
  • Low minimum fund, $50 or so...
  • Relatively low commissions compared to other exchanges
  • High leverage if you wish so 8-)

Project page
https://github.com/BookmapAPI/bitmex-adapter
click release tab to download the adapter in its current stage, put it under C:\Bookmap\API\Layer0ApiModules, configure connection, connect, subscribe (e.g. XBTUSD).

Target connection API
https://www.bitmex.com/app/restAPI
https://www.bitmex.com/app/wsAPI

General status
Supports market data and trading

Market Data
There are no major issues, but some tasks to be completed (listed in the project page)

Trading
To generate API keys visit your account at https://www.bitmex.com/app/apiKeys (real account) or https://testnet.bitmex.com/app/apiKeys (the paper trade account). Note that testnet requires a separate registration. The market data on testnet isn't real.

No need to select Withdraw checkbox. This functionality isn't supported by the adapter.

Insert the two API keys into corresponding fields of connection configuration in Bookmap. In case of testnet, select "This is a demo account" checkbox.

Known issues:
  • Market orders sent on BitMEX web platform cause short disconnection of Bookmap and executions don't appear as icons.
  • Limit Orders sent on BitMEX web platform cause short disconnection of Bookmap, but appear on Bookmap chart.
  • No warning is shown if the account is marked as a Spam Account
  • If a Bracket Order parent gets rejected by BitMEX the children will be placed anyway. They never get triggered though. If not cancelled manually they get canceled by BitMEX within 30s.
  • There is a chance that Executions and/or Cancelled info lacks orders. And the earlier the execution happened the higher the chance is.
Untested:
  • Stop Orders
  • Brackets, OCO, TP, SL
  • Trailing stop
  • TiF
  • Leverage and P&L computation
  • Stress test
Last edited by AndreyR on Thu Jul 12, 2018 6:46 pm, edited 4 times in total.

bob7123
Posts: 4
Joined: Thu Jul 12, 2018 1:53 pm

Re: BitMEX Adapter

Post by bob7123 » Fri Jul 13, 2018 3:00 pm

OK, I downloaded this and tried to get it going in Eclipse.

Short story, I am getting a lot of errors in Velox.api.layer0.live.Provider.balanceMap

For example:

BalanceInfo.BalanceInCurrency cannot be resolved to a type Provider.java /bitmex-adapter/src/velox/api/layer0/live line 86

Offending code: private Map<String, BalanceInfo.BalanceInCurrency> balanceMap = new HashMap<>();

Perhaps this is something simple, but as this is all new to me, I'm a bit stumped. Any ideas?

Thanks,
-Bob

Serg
Posts: 48
Joined: Mon Jun 11, 2018 12:40 pm
Has thanked: 7 times
Been thanked: 2 times

Re: BitMEX Adapter

Post by Serg » Mon Jul 16, 2018 4:34 pm

Hi Bob,
Are you able to use the compiled adapter (from the "release" tab) without Eclipse, i.e. not in debug mode?

bob7123
Posts: 4
Joined: Thu Jul 12, 2018 1:53 pm

Re: BitMEX Adapter

Post by bob7123 » Wed Jul 18, 2018 6:44 am

Serg wrote:
Mon Jul 16, 2018 4:34 pm
Hi Bob,
Are you able to use the compiled adapter (from the "release" tab) without Eclipse, i.e. not in debug mode?
I'm actually not seeing a release tab. Could it be a rights issue on your end? An idiot issue on my end? ;)

Can you share a URL where it should be?

Thanks,
-Bob

Serg
Posts: 48
Joined: Mon Jun 11, 2018 12:40 pm
Has thanked: 7 times
Been thanked: 2 times

Re: BitMEX Adapter

Post by Serg » Thu Aug 30, 2018 10:47 am

bob7123 wrote:
Wed Jul 18, 2018 6:44 am
I'm actually not seeing a release tab.
Bob, I remember that we resolved this via email or skype, but I'll leave an answer here to be available for others. Here, it's marked on the image. However, most users don't need it anymore because adapters are now available to install via Bookmap: How to install a Bookmap Connect adapter?

release tab.png
release tab.png (19.02 KiB) Viewed 1018 times

Online
Svyatoslav
Site Admin
Posts: 13
Joined: Mon Jun 11, 2018 11:44 am

Re: BitMEX Adapter

Post by Svyatoslav » Wed Nov 07, 2018 10:32 am

Version 0.5 is available. You should be able to get an update via Settings->Manage plugins menu in Bookmap. You can also get it directly from GitHub, but it's recommended to use bookmap plugin management instead.

minyPB
Posts: 1
Joined: Sun Nov 11, 2018 6:15 pm

Re: BitMEX Adapter

Post by minyPB » Sun Nov 11, 2018 6:22 pm

Hello. I have the latest beta version of bookmap 7.0.0 build 49. I installed Bitmex adapter but I can't connect to it. When I want to connect to bitmex it return to me information : Invalid credentials. Reason: invalid API key. My credentials are ok. Where to put my bitmex api key? There is no place to put it there. Could anybody help me? Thanks
zz.jpg
connetion error
zz.jpg (10.97 KiB) Viewed 243 times

AndreyR
Posts: 2
Joined: Mon Jul 09, 2018 11:18 am

Re: BitMEX Adapter

Post by AndreyR » Mon Nov 12, 2018 11:03 am

Hello minyPB
When you registered an API key for BitMEX they gave you an ID and a Key ('Secret') (see the attached picture)
Bookmap -> Connection -> Configure
Choose your BitMEX connection, insert your ID in the 'Username' field and your Key in the 'Password' field.

Important: testnet keys (aquired from testnet.bitmex.com) will only work for the testnet exchange and make sure the checkbox 'This is a demo account' is checked for the testnet.
Non-testnet keys (aquired from www.bitmex.com) must be used for the real exchange and in this case the checkbox 'This is a demo account' must be UNchecked.
Attachments
BitMEX_keys.jpg
BitMEX_keys.jpg (16.44 KiB) Viewed 236 times

Post Reply