What is Leverage Trading With Cryptocurrency?

Monfex

Cryptocurrency trading platform - offers easy-to-understand margin trading for top digital coins with up to 50X leverage.
[link]

COBINHOOD Exchange

COBINHOOD is the world's first "ZERO Trading Fees" cryptocurrency exchange with the vision to maximize traders' profits. Traders now can enjoy ZERO trading fees for spot trading and margin trading up to 10x leverage.
[link]

Bybit

Bybit is a cryptocurrency derivatives exchange offering trading on linear and inverse perpetual contracts with up to 100x leverage, providing users with a highly secure, state of the art matching engine, 24/7 service, and an advanced order system. Get started now: https://bybit.com
[link]

What Is Cryptocurrency Leverage Trading And The Risks That Come With It

What Is Cryptocurrency Leverage Trading And The Risks That Come With It submitted by areddituser46 to CryptoCurrencies [link] [comments]

What Is Cryptocurrency Leverage Trading And The Risks That Come With It

What Is Cryptocurrency Leverage Trading And The Risks That Come With It submitted by areddituser46 to ethtrader [link] [comments]

What Is Cryptocurrency Leverage Trading And The Risks That Come With It

What Is Cryptocurrency Leverage Trading And The Risks That Come With It submitted by areddituser46 to CryptoMarkets [link] [comments]

Cryptocurrency Leverage Trading

Cryptocurrency Leverage Trading submitted by Trade-herald to u/Trade-herald [link] [comments]

Japan Capping Cryptocurrency Leverage Trading in April 2020

Japan Capping Cryptocurrency Leverage Trading in April 2020 submitted by Ranzware to BitNewsLive [link] [comments]

Bitseven provides secure cryptocurrency leveraged trading

Bitseven provides secure cryptocurrency leveraged trading
Cryptocurrency-leveraged trading provides a great opportunity to increase your capital.

BItSeven.com - Profit can be greatly expanded with less capital. You can take advantage of both rising and falling cryptocurrencies. The cryptocurrency market is open all day, every day. Leveraged trading allows you to react quickly to price fluctuations and take advantage of short-term volatility.
99.999% service availability Time-proven financial stability 0% user’s fund theft
BitSEVEN | Bitcoin leveraged trade at 100x leverage maximum, 100% profit at 1% price raise Make a profit whether the bitcoin price rises or falls BITCOIN LEVERAGED TRADING YOU CAN TRUST.


https://preview.redd.it/lmqq2z8d2yw21.png?width=695&format=png&auto=webp&s=6068d6d564520e18ac2e3ca0f82ff5799bb76fd8
submitted by Bitcoin_Exchange7 to u/Bitcoin_Exchange7 [link] [comments]

WhiteBit Launches Margin Trading With 5x Leverage (x-post from /r/cryptocurrency)

WhiteBit Launches Margin Trading With 5x Leverage (x-post from /cryptocurrency) submitted by ASICmachine to CryptoCurrencyClassic [link] [comments]

FXF on Twitter: Finxflo is a global cryptocurrency brokerage trading platform to provide the best prices of digital currencies. Traders leverage market depth & liquidity by accessing 25+ exchanges.

FXF on Twitter: Finxflo is a global cryptocurrency brokerage trading platform to provide the best prices of digital currencies. Traders leverage market depth & liquidity by accessing 25+ exchanges. submitted by PS-Group to FXF [link] [comments]

07-14 05:04 - 'Phemex Exchange Offering Bitcoin Leverage Trading With trading engines that are ten times faster as compared to other cryptocurrency exchanges.' (thecryptobasic.com) by /u/jakkkmotivator removed from /r/Bitcoin within 23-33min

Phemex Exchange Offering Bitcoin Leverage Trading With trading engines that are ten times faster as compared to other cryptocurrency exchanges.
Go1dfish undelete link
unreddit undelete link
Author: jakkkmotivator
submitted by removalbot to removalbot [link] [comments]

Detailed explanation of BitMEX pending order strategy

article originally from FMZ.COM ( A place you can create your own trading bot by Python, JavaScript and C++) 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.
var ticker = {price:0, buy:0, sell:0, time:0} //Ticker information, the latest price, "buy one" price, "sell one" price, update time //Account information, respectively, position, buying and selling price, buying and selling quantity, position status, order Id var info = {position:0, buyPrice:0, sellPrice:0, buyAmount:0, sellAmount:0, buyState:0, sellState:0, buyId:0, sellId:0} var buyListId = []//Global variables, pre-emptive buying id list, will described below var sellListId = [] var APIKEY = 'your api id' //Need to fill in the BitMEX API ID here. Note that it is not a key, which is required for websocket protocol authentication. var expires = parseInt(Date.now() / 1000) + 10 var signature = exchange.HMAC("sha256", "hex", "GET/realtime" + expires, "{{secretkey}}")//The secretkey will be automatically replaced at the bottom level and does not need to be filled in. var bitmexClient = Dial("wss://www.bitmex.com/realtime", 60) var auth = JSON.stringify({args: [APIKEY, expires, signature], op: "authKeyExpires"})//Authentication information, otherwise you cannot subscribe to the account bitmexClient.write(auth) bitmexClient.write('{"op": "subscribe", "args": ["position","execution","trade:XBTUSD"]}')//Subscribed to positions, order execution and perpetual contract real-time transaction while(true){ var data = bitmexClient.read() if(data){ bitmexData = JSON.parse(data) if('table' in bitmexData && bitmexData.table == 'trade'){ data = bitmexData.data ticker.price = parseFloat(data[data.length-1].price)//The latest transaction price, will push multiple transactions at a time, take one will be ok //You can get the "buy one" and "sell one" price according to the direction of the latest transaction, without subscribing to the depth. if(data[data.length-1].side == 'Buy'){ ticker.sell = parseFloat(data[data.length-1].price) ticker.buy = parseFloat(data[data.length-1].price)-0.5 }else{ ticker.buy = parseFloat(data[data.length-1].price) ticker.sell = parseFloat(data[data.length-1].price)+0.5 } ticker.time = new Date(data[data.length-1].timestamp);//Update time, can be used to determine the delay } }else if(bitmexData.table == 'position'){ var position = parseInt(bitmexData.data[0].currentQty) if(position != info.position){ Log('Position change: ', position, info.position, '#[email protected]')//Position change Log, and pushed to WeChat, remove @ means Do not push info.position = position } info.position = parseInt(bitmexData.data[0].currentQty) } }

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:
// Cancel all orders and reset global variables function cancelAll(){ exchange.IO("api","DELETE","/api/v1/ordeall","symbol=XBTUSD")//Call IO extension revocation info = {position:0, buyPrice:0, sellPrice:0, buyAmount:0, sellAmount:0, buyState:0, sellState:0, buyId:0, sellId:0} buyListId = [] sellListId = [] } //placing alternate order function waitOrders(){ var orders = [] if(buyListId.length<4){ //When the number of inspections is insufficient, place another "bulk" for(var i=0;i<7;i++){ //Due to BitMEX restrictions, the price can not be excessively excessive, the order quantity can not be too small, and the "execInst" parameter guarantees that only the market making transaction can be executed. orders.push({symbol:'XBTUSD', side:'Buy', orderQty:100, price:ticker.buy-400+i, execInst:'ParticipateDoNotInitiate'}) } } if(sellListId.length<4){ for(var i=0;i<7;i++){ orders.push({symbol:'XBTUSD', side:'Sell', orderQty:100, price:ticker.buy+400+i, execInst:'ParticipateDoNotInitiate'}) } } if(orders.length>0){ var param = "orders=" + JSON.stringify(orders); var ids = exchange.IO("api", "POST", "/api/v1/ordebulk", param);//Bulk orders submitted here for(var i=0;i0){ info.position = pos[0].Type == 0 ? pos[0].Amount : -pos[0].Amount }else{ info.position = 0 } } //Unknown error cannot be modified, all orders are cancelled, reset once else if(err.includes('Invalid orderID')){ cancelAll() Log('Invalid orderID,reset once') } //Exceed the frequency limit, you can continue to try after hibernation else if(err.includes('Rate limit exceeded')){ Sleep(2000) return } //The account is banned, all orders are revoked, and sleep is awaiting recovery for a long time. else if(err.includes('403 Forbidden')){ cancelAll() Log('403,reset once') Sleep(5*60*1000) } }else{ //Modify order successfully if(direction == 'buy'){ info.buyState = 1 info.buyPrice = price info.buyAmount = amount }else{ info.sellState = 1 info.sellPrice = price info.sellAmount = amount } } } //0.5 price change function fixSize(num){ if(num>=_N(num,0)+0.75){ num = _N(num,0)+1 }else if(num>=_N(num,0)+0.5){ num=_N(num,0)+0.5 }else{ num=_N(num,0) } return num } //Trading function function trade(){ waitOrders()//Check if you need a replacement order var buyPrice = fixSize(ticker.buy-5) //For demonstration purposes only, specific transactions should be written by yourself. var sellPrice = fixSize(ticker.sell+5) var buyAmount = 500 var sellAmount = 500 //Modify from an alternate order when there is no order if(info.buyState == 0 && buyListId.length > 0){ info.buyId = buyListId.shift() amendOrders([{orderID:info.buyId, price:buyPrice, orderQty:buyAmount}],'buy', group, buyPrice, buyAmount, info.buyId) } if(info.sellState == 0 && sellListId.length > 0){ info.sellId = sellListId.shift() amendOrders([{orderID: info.sellId, price:sellPrice, orderQty:sellAmount}],'sell', group, sellPrice, sellAmount, info.sellId ) } //Existing orders need to change price if(buyPrice != info.buyPrice && info.buyState == 1){ amendOrders([{orderID:info.buyId, price:buyPrice, orderQty:buyAmount}],'buy', group, buyPrice, buyAmount) } if(sellPrice != info.sellPrice && info.sellState == 1){ amendOrders([{orderID:info.sellId, price:sellPrice, orderQty:sellAmount}],'sell', group, sellPrice, sellAmount) } }

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 ( A place you can create your own trading bot by Python, JavaScript and C++) https://www.fmz.com/bbs-topic/2710
submitted by FmzQuant to BitMEX [link] [comments]

Detailed explanation of BitMEX pending order strategy

article originally from FMZ.COM ( A place you can create your own trading bot by Python, JavaScript and C++)
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.
var ticker = {price:0, buy:0, sell:0, time:0} //Ticker information, the latest price, "buy one" price, "sell one" price, update time //Account information, respectively, position, buying and selling price, buying and selling quantity, position status, order Id var info = {position:0, buyPrice:0, sellPrice:0, buyAmount:0, sellAmount:0, buyState:0, sellState:0, buyId:0, sellId:0} var buyListId = []//Global variables, pre-emptive buying id list, will described below var sellListId = [] var APIKEY = 'your api id' //Need to fill in the BitMEX API ID here. Note that it is not a key, which is required for websocket protocol authentication. var expires = parseInt(Date.now() / 1000) + 10 var signature = exchange.HMAC("sha256", "hex", "GET/realtime" + expires, "{{secretkey}}")//The secretkey will be automatically replaced at the bottom level and does not need to be filled in. var bitmexClient = Dial("wss://www.bitmex.com/realtime", 60) var auth = JSON.stringify({args: [APIKEY, expires, signature], op: "authKeyExpires"})//Authentication information, otherwise you cannot subscribe to the account bitmexClient.write(auth) bitmexClient.write('{"op": "subscribe", "args": ["position","execution","trade:XBTUSD"]}')//Subscribed to positions, order execution and perpetual contract real-time transaction while(true){ var data = bitmexClient.read() if(data){ bitmexData = JSON.parse(data) if('table' in bitmexData && bitmexData.table == 'trade'){ data = bitmexData.data ticker.price = parseFloat(data[data.length-1].price)//The latest transaction price, will push multiple transactions at a time, take one will be ok //You can get the "buy one" and "sell one" price according to the direction of the latest transaction, without subscribing to the depth. if(data[data.length-1].side == 'Buy'){ ticker.sell = parseFloat(data[data.length-1].price) ticker.buy = parseFloat(data[data.length-1].price)-0.5 }else{ ticker.buy = parseFloat(data[data.length-1].price) ticker.sell = parseFloat(data[data.length-1].price)+0.5 } ticker.time = new Date(data[data.length-1].timestamp);//Update time, can be used to determine the delay } }else if(bitmexData.table == 'position'){ var position = parseInt(bitmexData.data[0].currentQty) if(position != info.position){ Log('Position change: ', position, info.position, '#[email protected]')//Position change Log, and pushed to WeChat, remove @ means Do not push info.position = position } info.position = parseInt(bitmexData.data[0].currentQty) } }

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:
// Cancel all orders and reset global variables function cancelAll(){ exchange.IO("api","DELETE","/api/v1/ordeall","symbol=XBTUSD")//Call IO extension revocation info = {position:0, buyPrice:0, sellPrice:0, buyAmount:0, sellAmount:0, buyState:0, sellState:0, buyId:0, sellId:0} buyListId = [] sellListId = [] } //placing alternate order function waitOrders(){ var orders = [] if(buyListId.length<4){ //When the number of inspections is insufficient, place another "bulk" for(var i=0;i<7;i++){ //Due to BitMEX restrictions, the price can not be excessively excessive, the order quantity can not be too small, and the "execInst" parameter guarantees that only the market making transaction can be executed. orders.push({symbol:'XBTUSD', side:'Buy', orderQty:100, price:ticker.buy-400+i, execInst:'ParticipateDoNotInitiate'}) } } if(sellListId.length<4){ for(var i=0;i<7;i++){ orders.push({symbol:'XBTUSD', side:'Sell', orderQty:100, price:ticker.buy+400+i, execInst:'ParticipateDoNotInitiate'}) } } if(orders.length>0){ var param = "orders=" + JSON.stringify(orders); var ids = exchange.IO("api", "POST", "/api/v1/ordebulk", param);//Bulk orders submitted here for(var i=0;i0){ info.position = pos[0].Type == 0 ? pos[0].Amount : -pos[0].Amount }else{ info.position = 0 } } //Unknown error cannot be modified, all orders are cancelled, reset once else if(err.includes('Invalid orderID')){ cancelAll() Log('Invalid orderID,reset once') } //Exceed the frequency limit, you can continue to try after hibernation else if(err.includes('Rate limit exceeded')){ Sleep(2000) return } //The account is banned, all orders are revoked, and sleep is awaiting recovery for a long time. else if(err.includes('403 Forbidden')){ cancelAll() Log('403,reset once') Sleep(5*60*1000) } }else{ //Modify order successfully if(direction == 'buy'){ info.buyState = 1 info.buyPrice = price info.buyAmount = amount }else{ info.sellState = 1 info.sellPrice = price info.sellAmount = amount } } } //0.5 price change function fixSize(num){ if(num>=_N(num,0)+0.75){ num = _N(num,0)+1 }else if(num>=_N(num,0)+0.5){ num=_N(num,0)+0.5 }else{ num=_N(num,0) } return num } //Trading function function trade(){ waitOrders()//Check if you need a replacement order var buyPrice = fixSize(ticker.buy-5) //For demonstration purposes only, specific transactions should be written by yourself. var sellPrice = fixSize(ticker.sell+5) var buyAmount = 500 var sellAmount = 500 //Modify from an alternate order when there is no order if(info.buyState == 0 && buyListId.length > 0){ info.buyId = buyListId.shift() amendOrders([{orderID:info.buyId, price:buyPrice, orderQty:buyAmount}],'buy', group, buyPrice, buyAmount, info.buyId) } if(info.sellState == 0 && sellListId.length > 0){ info.sellId = sellListId.shift() amendOrders([{orderID: info.sellId, price:sellPrice, orderQty:sellAmount}],'sell', group, sellPrice, sellAmount, info.sellId ) } //Existing orders need to change price if(buyPrice != info.buyPrice && info.buyState == 1){ amendOrders([{orderID:info.buyId, price:buyPrice, orderQty:buyAmount}],'buy', group, buyPrice, buyAmount) } if(sellPrice != info.sellPrice && info.sellState == 1){ amendOrders([{orderID:info.sellId, price:sellPrice, orderQty:sellAmount}],'sell', group, sellPrice, sellAmount) } }

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 ( A place you can create your own trading bot by Python, JavaScript and C++)
submitted by FmzQuant to CryptoCurrencyTrading [link] [comments]

📌What is Cryptocurrency?

📌What is Cryptocurrency?
👉1. Definition of Cryptocurrency As a kind of digital currency (also called virtual currency), cryptocurrency is a medium of exchange that uses cryptography to ensure the security of financial transactions and digital assets. Unlike the traditional currency or fiat, cryptocurrency is no longer issued and managed by central bank. Instead, it is generated from a decentralized and distributed ledger system, typically called blockchain, by calculating and solving some math problems. In other words, the process of cryptocurrency production is called mining. Here is an example of Bitcoin mining. 👉2. Current Transaction Modes for Cryptocurrency Similar to fiat currency, cryptocurrency is also tradable. There are 3 popular transaction modes for cryptocurrency on most crypto exchanges around the world. 1) Fiat to Crypto Trading You can use fiat currency to purchase cryptocurrency in crypto exchanges. Before that, you have to do KYC in the exchange platform, and adding your debit card or other payment methods. Then, you can choose to buy BTC, ETH, LTC or any other with fiat. 2) Crypto to Crypto Trading Transaction between cryptocurrencies means that you can use BTC to buy ETH, LTC, EOS and more. In fiat to crypto transaction, it uses fiat to price a kind of cryptocurrency. But in crypto to crypto trading, for example, BTC's current price is used to price another crytocurrency. 3) Cryptocurrency Leverage Trading In leverage trading, also called crypto futures trading, cryptocurrency holders can leverage their existing amount of tokens/digital assets to enter a larger trade. That means you must deposit the minimum amount of BTC, ETH, LTC, etc. as margin to open a position. Then, you can open long or open short, and choose 5x, 10x, 50x,etc. #Bexplus #BTC #cryptocurrency #crypto#btcnews
https://preview.redd.it/4ghhqfuw7qy21.png?width=564&format=png&auto=webp&s=ce2da86dcb23b54349f42820bb9ccd62904506a0
submitted by bexplus to u/bexplus [link] [comments]

/r/Bybit - Bybit is a cryptocurrency derivatives exchange offering trading on linear and inverse perpetual contracts with up to 100x leverage. Get started now: https://bybit.com... (12.02% growth)

submitted by TrendingCommenterBot to TrendingReddits [link] [comments]

Detailed explanation of BitMEX pending order strategy

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.
var ticker = {price:0, buy:0, sell:0, time:0} //Ticker information, the latest price, "buy one" price, "sell one" price, update time //Account information, respectively, position, buying and selling price, buying and selling quantity, position status, order Id var info = {position:0, buyPrice:0, sellPrice:0, buyAmount:0, sellAmount:0, buyState:0, sellState:0, buyId:0, sellId:0} var buyListId = []//Global variables, pre-emptive buying id list, will described below var sellListId = [] var APIKEY = 'your api id' //Need to fill in the BitMEX API ID here. Note that it is not a key, which is required for websocket protocol authentication. var expires = parseInt(Date.now() / 1000) + 10 var signature = exchange.HMAC("sha256", "hex", "GET/realtime" + expires, "{{secretkey}}")//The secretkey will be automatically replaced at the bottom level and does not need to be filled in. var bitmexClient = Dial("wss://www.bitmex.com/realtime", 60) var auth = JSON.stringify({args: [APIKEY, expires, signature], op: "authKeyExpires"})//Authentication information, otherwise you cannot subscribe to the account bitmexClient.write(auth) bitmexClient.write('{"op": "subscribe", "args": ["position","execution","trade:XBTUSD"]}')//Subscribed to positions, order execution and perpetual contract real-time transaction while(true){ var data = bitmexClient.read() if(data){ bitmexData = JSON.parse(data) if('table' in bitmexData && bitmexData.table == 'trade'){ data = bitmexData.data ticker.price = parseFloat(data[data.length-1].price)//The latest transaction price, will push multiple transactions at a time, take one will be ok //You can get the "buy one" and "sell one" price according to the direction of the latest transaction, without subscribing to the depth. if(data[data.length-1].side == 'Buy'){ ticker.sell = parseFloat(data[data.length-1].price) ticker.buy = parseFloat(data[data.length-1].price)-0.5 }else{ ticker.buy = parseFloat(data[data.length-1].price) ticker.sell = parseFloat(data[data.length-1].price)+0.5 } ticker.time = new Date(data[data.length-1].timestamp);//Update time, can be used to determine the delay } }else if(bitmexData.table == 'position'){ var position = parseInt(bitmexData.data[0].currentQty) if(position != info.position){ Log('Position change: ', position, info.position, '#[email protected]')//Position change Log, and pushed to WeChat, remove @ means Do not push info.position = position } info.position = parseInt(bitmexData.data[0].currentQty) } }

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:
// Cancel all orders and reset global variables function cancelAll(){ exchange.IO("api","DELETE","/api/v1/ordeall","symbol=XBTUSD")//Call IO extension revocation info = {position:0, buyPrice:0, sellPrice:0, buyAmount:0, sellAmount:0, buyState:0, sellState:0, buyId:0, sellId:0} buyListId = [] sellListId = [] } //placing alternate order function waitOrders(){ var orders = [] if(buyListId.length<4){ //When the number of inspections is insufficient, place another "bulk" for(var i=0;i<7;i++){ //Due to BitMEX restrictions, the price can not be excessively excessive, the order quantity can not be too small, and the "execInst" parameter guarantees that only the market making transaction can be executed. orders.push({symbol:'XBTUSD', side:'Buy', orderQty:100, price:ticker.buy-400+i, execInst:'ParticipateDoNotInitiate'}) } } if(sellListId.length<4){ for(var i=0;i<7;i++){ orders.push({symbol:'XBTUSD', side:'Sell', orderQty:100, price:ticker.buy+400+i, execInst:'ParticipateDoNotInitiate'}) } } if(orders.length>0){ var param = "orders=" + JSON.stringify(orders); var ids = exchange.IO("api", "POST", "/api/v1/ordebulk", param);//Bulk orders submitted here for(var i=0;i0){ info.position = pos[0].Type == 0 ? pos[0].Amount : -pos[0].Amount }else{ info.position = 0 } } //Unknown error cannot be modified, all orders are cancelled, reset once else if(err.includes('Invalid orderID')){ cancelAll() Log('Invalid orderID,reset once') } //Exceed the frequency limit, you can continue to try after hibernation else if(err.includes('Rate limit exceeded')){ Sleep(2000) return } //The account is banned, all orders are revoked, and sleep is awaiting recovery for a long time. else if(err.includes('403 Forbidden')){ cancelAll() Log('403,reset once') Sleep(5*60*1000) } }else{ //Modify order successfully if(direction == 'buy'){ info.buyState = 1 info.buyPrice = price info.buyAmount = amount }else{ info.sellState = 1 info.sellPrice = price info.sellAmount = amount } } } //0.5 price change function fixSize(num){ if(num>=_N(num,0)+0.75){ num = _N(num,0)+1 }else if(num>=_N(num,0)+0.5){ num=_N(num,0)+0.5 }else{ num=_N(num,0) } return num } //Trading function function trade(){ waitOrders()//Check if you need a replacement order var buyPrice = fixSize(ticker.buy-5) //For demonstration purposes only, specific transactions should be written by yourself. var sellPrice = fixSize(ticker.sell+5) var buyAmount = 500 var sellAmount = 500 //Modify from an alternate order when there is no order if(info.buyState == 0 && buyListId.length > 0){ info.buyId = buyListId.shift() amendOrders([{orderID:info.buyId, price:buyPrice, orderQty:buyAmount}],'buy', group, buyPrice, buyAmount, info.buyId) } if(info.sellState == 0 && sellListId.length > 0){ info.sellId = sellListId.shift() amendOrders([{orderID: info.sellId, price:sellPrice, orderQty:sellAmount}],'sell', group, sellPrice, sellAmount, info.sellId ) } //Existing orders need to change price if(buyPrice != info.buyPrice && info.buyState == 1){ amendOrders([{orderID:info.buyId, price:buyPrice, orderQty:buyAmount}],'buy', group, buyPrice, buyAmount) } if(sellPrice != info.sellPrice && info.sellState == 1){ amendOrders([{orderID:info.sellId, price:sellPrice, orderQty:sellAmount}],'sell', group, sellPrice, sellAmount) } }

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.
submitted by FmzQuant to CryptoCurrencies [link] [comments]

Cryptocurrency Exchange Margin Trading With Leverage

Cryptocurrency Exchange Margin Trading With Leverage submitted by CrucialSir to u/CrucialSir [link] [comments]

Leveraged Trading & Bitmex Tutorial (High Risk Not For Beginners) (x-post from /r/cryptocurrency)

Leveraged Trading & Bitmex Tutorial (High Risk Not For Beginners) (x-post from /cryptocurrency) submitted by ASICmachine to CryptoCurrencyClassic [link] [comments]

First rule of leveraged trading (x-post from /r/cryptocurrency)

submitted by ASICmachine to CryptoCurrencyClassic [link] [comments]

Leverage Trading Cryptocurrency (On Kraken exchange)

I opened a leverage trade today on Kraken exchange, but my funds (euro) were still on my account after making a trade into Bitcoin.
Is it normal for funds to not be taken after buying an asset with leverage?
submitted by kommokam to Daytrading [link] [comments]

TradeHerald Becomes The First 100x Leverage Cryptocurrency Exchange with Zero Trading Fees

TradeHerald Becomes The First 100x Leverage Cryptocurrency Exchange with Zero Trading Fees submitted by IdahoAnalytic to Crypto_Currency_News [link] [comments]

TradeHerald Becomes The First 100x Leverage Cryptocurrency Exchange with Zero Trading Fees

TradeHerald Becomes The First 100x Leverage Cryptocurrency Exchange with Zero Trading Fees submitted by sexyama to crypto_currency [link] [comments]

New trading bonus campaign for cryptocurrency traders around the world. The campaign is launched by the best leverage trade exchange platform called Amanpuri. Good prizes in cryptocurrency assets ( BTC) is available to winners of the trading competition. https://amanpuri.io/?ref=b5622039

New trading bonus campaign for cryptocurrency traders around the world. The campaign is launched by the best leverage trade exchange platform called Amanpuri. Good prizes in cryptocurrency assets ( BTC) is available to winners of the trading competition. https://amanpuri.io/?ref=b5622039 submitted by Cryptosaurus94 to cryptocurrencynews [link] [comments]

#Long #XBT @ 6090-6020 - Free bitMEX Binance Leverage Signals Crypto Signal APP & bitMEX Trading BOT | CryptoInTalk | Largest Cryptocurrency Forum

#Long #XBT @ 6090-6020 - Free bitMEX Binance Leverage Signals Crypto Signal APP & bitMEX Trading BOT | CryptoInTalk | Largest Cryptocurrency Forum submitted by CryptotradingSignals to altcoin_news [link] [comments]

Cryptocurrency Leverage Trading Intro (Part 2) : There's only 2 reasons why we use Coinbase Pro Introduction to Leverage And Margin - YouTube Leverage Trading Bitmex  Cryptocurrency Trading - YouTube Bitmex Leverage Trading Introduction for Beginners ... Comprehensive Guide to Trading Crypto in 2020 (Exchanges, Leverage, KYC)

BitMEX is a P2P crypto-products trading platform. BitMEX and the mobile apps issued under BMEX are wholly owned and operated by HDR Global Trading Limited, a Republic of Seychelles incorporated entity or its relevant authorised affiliates. Cryptocurrency charts by TradingView. With an excellent charting interface, zero deposit fees, competitive trading fees and various traditional assets to trade with leverage, PrimeXBT is without a doubt one of the best cryptocurrency trading exchanges to trade Bitcoin with margin. Create a free account with Prime XBT. Plus500 FXOpen is an older, well established, regulated CFD broker offering traditional trading assets but also cryptocurrency margin trading with small leverage. Deposits and Cashouts – Fiat Money Supported: The professional international broker supports fiat money payments as well as cryptocurrency transfers. Currency trading often involves investors using leverage to try and profit from both price fluctuations and differences in exchange rates. Leverage is simply a loan provided to an investor by a broker or exchange that controls the investor’s trading account. Once an investor has secured the additional funds they need to embark on margin trading. Bitcoin margin trading, in simple words, allows opening a trading position with leverage, by borrowing funds from the exchange. For example, if we opened a Bitcoin margin position with a 2X leverage and Bitcoin had increased by 10%, then our position would have yielded 20% because of the 2X leverage.

[index] [29] [183] [163] [85] [61] [179] [51] [46] [133] [103]

Cryptocurrency Leverage Trading Intro (Part 2) : There's only 2 reasons why we use Coinbase Pro

The BitSeven Crypto Trading Platform is a leveraged trading platform, which gives you the ability to trade up to 100x margin. They have reasonable fee structure, compared to their competitors. Leverage is your friend when trading Bitcoin (BTC), Chainlink (LINK) or any other Cryptocurrency, but only if you use it correctly. 💎 Switch to Phemex, fastest and most secure margin trading ... Trading & investing in cryptocurrency carries a high level of risk and may not be suitable for all investors. The high degree of leverage and the lack of regulation in the market can work against ... https://www.bitmex.com/register/UfemlS - If you need a Bitmex account Beginner introduction to Bitmex leverage trading - this video goes over the UI, basic t... "Trading involves RISK. Before Starting To Trade On The Platform, You Need To Analyze Your Financial Capabilities And Familiarize Themselves With The Terms Of The Agreement On The Provision Of ...

#