Title: Detailed explanation of BitMEX pending order strategy Post by: henrythebest on January 16, 2019, 07:38:23 AM article originally from FMZ.COM if the code part is not clear to see, please come to here: https://www.fmz.com/bbs-topic/2710 (https://www.fmz.com/bbs-topic/2710)
BitMEX has become the platform of choice for cryptocurrency leverage trading, but its API trading restrictions are strict and make automatic traders feeling very confused. This article mainly shares some tips on the use of APIs in the FMZ quantitative trading platform, mainly for the market making strategy. 1. Features of BitMEX The most significant advantage is that the trading liquidity is very active, especially the Bitcoin perpetual contract, the transaction amount per minute often exceeds one million or even ten million US dollars; BitMEX pending orders trading have the policy of return commission fee, although it is not much, but attracted a large number of market making tradings, which made the price depth very rich. the latest buying and selling price often have more than one million dollars worth pending orders; because of this point, the transaction price often fluctuates around the minimum change unit of $0.50. 2.BitMEX API frequency limit The request frequency of the REST API is limited to 300 times every 5 minutes, almost equal to 1 time every second, this limit can be said to be very strict compared to other trading platforms. After the limit is exceeded, 'Rate limit exceeded' will be prompted. If you keep exceeding the limit, the IP may be disabled for one hour. Multiple disables in a short time will result in a week being disabled. For each API request, BitMEX will return the header data, header data is used to see the current number of remaining requests. In fact, if the API is used properly, it will not exceed the frequency limit and generally does not need to be checked. 3.Use websocket to get the market quote The BitMEX REST API is more restrictive. The official recommendation is to use the websocket protocol more, and push more data types than the average exchange. Pay attention to the following points for specific use: If the depth data push time is too long, there will be an error, which does not correspond to the real depth. It is estimated that there are too many depth changes and there are omissions in the push, but in general, due to excellent fluidity, you can subscribe to "ticker" or "trades". The order details push is missing a lot and is almost unavailable. There is a significant delay in the push of account information, preferably using the REST API. When the market is volatile too big, the push delay will reach a few seconds. The following code uses the websocket protocol to obtain market and account information in real time, mainly for market-making strategies. The specific use needs to be performed in the main() function. Code: var ticker = {price:0, buy:0, sell:0, time:0} //Ticker information, the latest price, "buy one" price, "sell one" price, update time 4. Placing order skills BitMEX officially recommends using "bulk ordering" and "order modification" to place order. "bulk ordering" can be executed faster due to BitMEX real-time auditing, risk checking, margin calculation, and commissioning. Therefore, the frequency of the "bulk ordering" is calculated as one tenth of the normal frequency. Futhermore, our order operation should use the method of "bulk ordering" and "order modification" to minimize the use of API. The query order status also needs to consume the API using frequency. It can judge the order status according to the position change or modification order failure. "bulk ordering" does not limit the order quantity (can't be too much), in fact, a single order can also use the "bulk ordering" interface. Due to the operation of modifying the order, we can "pre-order" some orders where the price deviates greatly, these orders will not be executed, but when we need to place an order, we only need to modify the price and quantity of the placed order. when modifying the order occurs failure, it can also be used as a signal for the order to be executed. The following is the specific implementation code: Code: // Cancel all orders and reset global variables 5. Others BitMEX's server is in the Amazon's server in Dublin, Ireland. The server running strategy ping is less than 1ms when you choose a AWS cloud sever in Dublin, but when there is still a delay in pushing, the overload problem cannot be solved. In addition, when the account is logged in, the server agent cannot be located in the United States and other places where don't allow cryptocurrency tradings. Due to the regulation, the account will be banned. The code in this article has been modified from my personal strategy and is not guaranteed to be completely correct for reference. The specific use of the market code should be executed in the main function, the trading-related code is placed before the main function, and the trade() function is placed in the push market quote. article originally from FMZ.COM if the code part is not clear to see, please come to here: https://www.fmz.com/bbs-topic/2710 (https://www.fmz.com/bbs-topic/2710) Title: Re: Detailed explanation of BitMEX pending order strategy Post by: henrythebest on January 17, 2019, 12:59:31 AM noone cares?
Title: Re: Detailed explanation of BitMEX pending order strategy Post by: iamyourfather777 on January 18, 2019, 04:27:29 AM so what programming is this? your platform's own programming language?
Title: Re: Detailed explanation of BitMEX pending order strategy Post by: henrythebest on January 18, 2019, 05:25:46 AM you can use Python, C++, JavaScript, or (M Language, a kind of language where originally came from a Chinese futures automatic trading software, very easy to use, all the funcitons are highly integrated), also lots of strategies you can rent buy or sell. mainly design for building your own trading bot by the easiest way.
Title: Re: Detailed explanation of BitMEX pending order strategy Post by: iamyourfather777 on January 18, 2019, 06:59:54 AM thanks a lot, i don't think this for me, i don't know anything about programming. i saw you have post a lot of strategies here, is there anyone i can just use manual trading method, the old-fashioned but most effective way.
Title: Re: Detailed explanation of BitMEX pending order strategy Post by: henrythebest on January 19, 2019, 01:23:55 AM thanks a lot, i don't think this for me, i don't know anything about programming. i saw you have post a lot of strategies here, is there anyone i can just use manual trading method, the old-fashioned but most effective way. don't worry about that, if you really have a great idea about trading, we can help you make it happen, or you just don't want programming at all, with a little cost, we will write it for you, you can test the code anywhere, because we will provide the source code with the strategy. Title: Re: Detailed explanation of BitMEX pending order strategy Post by: iamyourfather777 on January 21, 2019, 09:48:21 AM thx man
|