Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 15:11:57 +0000



[Locked] - Direct BitMEX Trading Support

View Count: 10294

[2018-02-16 04:25:32]
Sierra Chart Engineering - Posts: 104368
In version 1703 there is a new Global Settings >> Data/Trade Service Settings >> Service named "BitMEX Trading Direct".

This uses Sierra Chart's own direct integration to the BitMEX trading API. This is released and tested. But should still be tested in BitMEX testnet or with small quantities so that it is proven that it works well for you. Testing on your side is important as well.

Instructions:
1. Update Sierra Chart to prerelease 1703 by selecting Help >> Download Prerelease. Refer to:
Software Download: Fast Update

2. Set Global Settings >> Data/Trade Service Settings >> Service to "BitMEX Trading Direct".


3. Set the Service Setting >> Server to either Live or Testnet depending upon which BitMEX server you want to use.

4. Obtain your API Key and API Secret through your BitMEX account on the BitMEX website. Enter those into the corresponding Service Settings in Global Settings >> Data/Trade Service Settings .

For instructions:
https://www.bitmex.com/app/dtcIntegration

Also refer to the attached screenshot.

You will have a different API key and secret for your Live account as compared to Testnet. So you do not have to keep reentering these when you change between Live or Testnet, use the ability to save and load Service Settings configurations documented here:
Data/Trade Service Settings: Saving and Loading Service Settings

5. Press OK.

6. Connect to the server with File >> Connect to Data Feed.

7. This connection to BitMEX supports both the market data from the Live server and the Testnet server no matter how the Server is set above.


8. Open a chart through File >> Find Symbol. You will have to get the symbols and this is explained here:
File Menu: Getting Symbols

9. You can use either BitMEX Live and/or Testnet symbols. However, when trading if you are using the Live server (step #3 ) you can only trade from a chart that uses the BitMEX Live symbols. If you have connected Sierra Chart to the BitMEX Testnet server (step #3 ) , you can only trade from a chart that uses the BitMEX Testnet symbols. Otherwise an error will occur on order submission.

10. For complete trading documentation, refer to:

Overview of Trading

11. Disable Trade >> Trade Simulation Mode On.

12. Make sure you have selected the correct Trade Account on the Trade Window. Refer to:
Basic Trading and the Trade Window: Main/C >> Trade Account (Selecting Trade Account for Chart / Trade DOM)



We will update this thread as needed with any additional information.

----
Background information: Sierra Chart integration to BitMEX has been through a DTC protocol server which BitMEX is using which was developed by another developer. This was not developed by us. At times users are having trouble with BitMEX trading integration in part because of this particular server, and for other reasons which we are not totally aware of because the issues are not within Sierra Chart.

In no case are the problems within Sierra Chart. Since BitMEX integration has become available since about April of last year, there have only been two minor issues which were on our side or which we were able to address and were taken care of immediately. The other issues were never on our side at all. Unfortunately, when users have trouble it does create a poor impression for us as well.

This post describes direct integration that we developed ourselves to BitMEX using their standard API. The DTC protocol is a vastly superior well-organized protocol and BitMEX and other exchanges should have direct adoption for it, but unfortunately this is just not the case.

However, in regards to DTC, one alternative method we could use is we could allow the users to connect directly to BitMEX through their DTC gateway.. So this is something that is still a possibility. We do think that this will alleviate some of the problems.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-02-21 00:56:35
imageNew Sierra Chart BitMEX integration page 2018.png / V - Attached On 2018-02-21 00:55:44 UTC - Size: 791.84 KB - 1149 views
[2018-02-16 07:22:02]
Sierra Chart Engineering - Posts: 104368
So please do provide feedback here so we can know how the new trading integration to BitMEX is working for users.

We just released a new revision of 1703 where we have now added the error message from BitMEX when there is an order reject.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-02-16 07:38:23
[2018-02-16 08:38:40]
Sierra Chart Engineering - Posts: 104368
Now that Sierra Chart has direct integration to BitMEX, and Sierra Chart has its own full DTC protocol server (Data and Trading Communications (DTC) Protocol Server ), Sierra Chart itself is now a high quality and very reliable bridge between BitMEX and the DTC Protocol which can be used by anyone. And at some point, we may create common centralized order routing as well using this bridge.

It is things like this that makes Sierra Chart an absolutely incredible and powerful trading and charting program.

So we are finally hopeful that we have turned around this situation with BitMEX for the benefit of the users.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-02-16 08:42:22
[2018-02-18 23:14:38]
User342238 - Posts: 44
Hi, following step one I have been upgraded to 1704. I cannot figure out step 4 or how to get these keys. My bitmex account is showing only one key for Sierra. Currently my implementation is trying to connect repeatedly to bitmex trading direct but it cannot.
[2018-02-18 23:38:32]
Sierra Chart Engineering - Posts: 104368
You should be able to create another key but we are waiting for instructions from BitMEX for this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-02-19 00:02:33]
User342238 - Posts: 44
Ok, I have no idea how to do this, will you post instructions here when it is ready?
[2018-02-19 00:17:43]
Sierra Chart Engineering - Posts: 104368
Yes. We just asked BitMEX for these.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-02-19 03:26:02]
N!co - Posts: 140
I succesfully added 1 account API's
how would I add a second account ?
[2018-02-19 06:36:44]
Sierra Chart Engineering - Posts: 104368
A second trading account is not supported with this kind of connection model. It would require us to use the BitMEX multiplexing feature which we have not yet implemented.

So the solution is just to install a second copy of Sierra Chart and set it to use a different API key.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-02-19 07:28:10]
User732495 - Posts: 6
First of all, thanks for making this possible. I know that a lot of users were breathing down your neck regarding Bitmex.

We tested it on Friday and so far it seems to be working quite well, at least order submission and fill information are not slower than via the website.

We use it everyday and keep you posted in case we find any bugs or issues.


To other users: in order to connect, you don't go the traditional route (Sierra Chart integration), you have to go to API->create API key + API secret. Then fill in the information into SC according to the instructions
[2018-02-19 14:57:45]
User342238 - Posts: 44
Hi, where is "API->create API key + API secret" found exactly. I am here, on bitmex webpage but do not see anything about secret api. https://www.bitmex.com/app/apiKeys

Thanks
[2018-02-19 16:41:53]
User732495 - Posts: 6
There’s no secret API. Just issue a new API and receive the API plus API secret (basically two codes) make sure you check “order” so SC can send and cancel orders.
[2018-02-19 20:53:48]
User271989 - Posts: 44
i am running the same bot wiht no modifications but today the bot started to send order at price "X" where X is the stop loss.

so for example if my stop loss is 10 dollars the study will send a stop at price "10" (if my stop is 10 and price is at 10.010 the stop should be 10.000, not "10")

again: there was no change in the code. It is a new error from bitmex?
Date Time Of Last Edit: 2018-02-19 21:26:00
[2018-02-19 22:47:51]
Sierra Chart Engineering - Posts: 104368


so for example if my stop loss is 10 dollars the study will send a stop at price "10" (if my stop is 10 and price is at 10.010 the stop should be 10.000, not "10")

again: there was no change in the code. It is a new error from bitmex?
What you need to do in this particular case is check the Trade Activity Log:
Trade Activity Log: Viewing Historical Trade Activity

And find out exactly what is the price being specified by the automated trading system when the order is in an Order Sent status. If it is wrong when the status is Order Sent , then the problem is with the automated trading system.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-02-19 22:49:47
[2018-02-21 01:03:15]
Sierra Chart Engineering - Posts: 104368
Step 4 in post #1 has been updated and we have attached this screenshot:
https://www.sierrachart.com/Download.php?Folder=SupportBoard&download=16583
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-02-21 12:50:20]
User198817 - Posts: 56
When using the Direct integration, a position is drawn on the TradeDOM and Chart. But after a few seconds it is removed. Have to click "refresh trade data from service" to have it appear again, only to disappear after a few seconds again.
[2018-02-21 19:10:34]
Sierra Chart Engineering - Posts: 104368
This is unusual.

The usual reason for this behavior:
When using the Direct integration, a position is drawn on the TradeDOM and Chart. But after a few seconds it is removed.

Is that the Trade Account of the chart does not match the trade account of the Position on Trade >> Trade Orders and Positions >> Positions. But if that were the case you would not be able to submit the order to begin with.

See if the Trade Account on the Trade Window for the chart matches what you see on Trade >> Trade Orders and Positions >> Positions for a particular position. Also make sure the symbol matches exactly. Both of these need to match exactly.

Refer to:
Basic Trading and the Trade Window: Main/C >> Trade Account (Selecting Trade Account for Chart / Trade DOM)
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-02-21 19:12:00
[2018-02-27 15:40:50]
User198817 - Posts: 56
(Think i have solved it. check update 3)

I did a fresh install of version 1705. The position in question was made using the old integration on the old installation.

The "positions" tab on Trade Orders and Positions, has a position by the trade account id that matches the chart trade window trade account id.

I only have 1 account.

I click "refresh data" and it appears on chart and dom for exactly 2 seconds before it is removed again.

Update 1: Orders sticks just fine and are removable by cancelling
Update 2: Selected LIVE in the server, in which i had forgot. It seemed to work, but only for a few more seconds before the position again is removed from chart.
Update 3: I closed my position and reopened it using the Direct integration. And now it sticks! Seems like a bug when there is a discrepancy in the TradeActivityLog or Positions.xml compared to the data fetched from Bitmex. Had to copy over the .dat and .xml files from the fresh installation into my original setup to fix the issue.
Date Time Of Last Edit: 2018-02-27 16:28:16
[2018-02-27 18:11:22]
Sierra Chart Engineering - Posts: 104368
Seems like a bug when there is a discrepancy in the TradeActivityLog or Positions.xml compared to the data fetched from Bitmex. Had to copy over the .dat and .xml files from the fresh installation into my original setup to fix the issue.

No. We now understand what the issue is. It is simply an average price issue where the average price is 0 and therefore the position line is not visible, since BitMEX does not provide a position average price. The Trade Window for the chart does show the correct Position Quantity. This section here explains more about this:
Trading Information Windows: How Average Price for Positions Is Calculated and Used




Best thing to do is to clear out the Trade Activity data for the Symbol and Trade Account.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-02-27 18:11:57
[2018-02-27 18:22:18]
Sierra Chart Engineering - Posts: 104368
Actually we see that they do provide a Position Average Price but not on apparently the streaming web socket connection. We need to look more into this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-02-27 19:12:31]
Sierra Chart Engineering - Posts: 104368
The problem with the Trade Position Average Price being 0 in some cases will be solved in the next release.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-02-27 20:52:39]
User198817 - Posts: 56
Great. Thanks for looking into it
[2018-02-28 05:41:08]
Sierra Chart Engineering - Posts: 104368
This issue is resolved in version 1708.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-03-02 08:08:58]
coin boss - Posts: 19
Anyone else having some serious problems with bitmex stop orders, i am on the new connetion (direct trading).
It seems as though the stop market orders are not working as i want them to. And after a little digging i found out why.

My guess is that Bitmex allows 3 different stop market triggers, the one that i want it to be using is the last price of the actual bitmex trades, but there is also the option of using the Mark price, or the index price. It looks like the orders through sierra are using the MARK price. so when price actually hits your level, it will NOT take you out of the trade. So the question is, how do we set the stop market order type so that the trigger price is the LAST price.
In the photo you can see the actual trigger price is not close to what the bitmex price is at... and when the trade was closed it was way way lower and you are blown out at that low lever.. and its costing me a lot of money, but im glad i figured out the reason why now. I just need to know how to let Sierra signal the proper stop market trigger type, the way stops normally work.

I can see another thread where someone mentioned the same issue a while ago, and the reply was:


Indeed, the execInst was set to Mark Price. I changed it to Last Price and this will be released in prod ASAP. Sorry for the inconvenience.


But it looks like its still the same issue with the current version.. or is there a way to change this trigger.


Thanks for your help.
image1.JPG / V - Attached On 2018-03-02 07:52:08 UTC - Size: 209.82 KB - 717 views
image3.JPG / V - Attached On 2018-03-02 08:02:42 UTC - Size: 54.97 KB - 614 views

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account