Litecoin Price in USD Real Time Litecoin Chart KITCO

Shuffle Token [SHUF]: A Deflationary Coin with Stacking Reward System 🃏🔥🚀

Shuffle.Monster V3 [Ticker: SHUF]
🃏 How it works?
1) There were originally 1,010,101 SHUF created.
2) Each time SHUF is transferred, 2% of the transaction is charged this way: 🔥 - 1% of the transaction is destroyed (Burned), 📦 - 1% is assigned randomly to one of the 512 Top Token Holders (Reward).
3) On each transaction a random holder (inside the top 512 holders) will have a reward of 1% of the transaction directly transferred to his address, making this a Stacking Currency by definition.
4) There will never be newly minted SHUF, so because of the constant burning, each day there is less SHUF, making this a Deflationary Currency by definition.
🔄 Distribution:
- All distribution via Free Airdrop, no ICO, no KYC, no social tasks - all Tokens can be obtained via smart contract interaction inside our official website (up to 1500 SHUFF per user) using any dApp Browser (Metamask, Trust Wallet internal Browser, Enjin, etc). At the date of this post, there are still 33% of SHUF to be claimed (join Airdrop here).
📈 SHUF Tokenomics:
☑️ SHUF is not just another BOMB copycat, in fact, besides the 1% burning rate, SHUF has nothing to do with BOMB or the hundreds of copycats in circulation.
☑️ SHUF contract was all coded from scratch and after 2 testing versions it includes now a lot of innovative features embedded into itself (including top notch security features).
☑️ The "Shuffle" reward method is fully automatic and doesn't require any sub-consequent contract interaction in order to claim rewards, no need to claim rewards as the rewards are transferred directly to the winner's address, so they can be obtained passively just by holding a position inside the heap (top 512 holders).
☑️ Like any Deflationary Currency, SHUF supply is constantly auto-destructing itself, leading to less and less SHUF in circulation and long term scarcity. So, part of the Tokenomics case for SHUF comes from it's deflationary nature, except it doesn't comes just from it (see next points).
☑️ The "Shuffle" Reward System gives another layer of value to SHUFF's case. Rewards are not for everyone, they are concentrated on the heap (top 512 holders), making them much more appealing because of the increased chances of reward on a daily basis.
☑️ The "Shuffle" Reward System has also viral potential, entertainment value, it's social oriented and above all: it's fun. Users tend to engage more organically inside SHUF community sharing their daily rewards, each time there's a bigger reward there's guaranteed organically interaction among the community. Despite their random nature, these rewards are guaranteed by math (with hundreds of transactions per day, a random reward is expected each day to each of the top 512 holders, but in the future with thousands of transactions, these rewards will be even more consistent).
☑️ SHUF has "transaction stimulation" coded by design, making it most likely that Token Transfers (and Burning) will always take place. This will happen because of the nature of the Reward System: users must remain in the Heap (Top 512) in order to receive rewards, and this leads to a variety of scenarios, all involving recurring transfers: . many users opt to split their holdings into several addresses, to increase their positions in the Heap; . as the Heap minimum holding gets higher, buying more SHUF is expected, leading to a double value factor: increased demand + more transfers/burning; . also as the Heap minimum holding gets higher, users that had previously divided their holdings into several addresses will be likely to move their tokens around and concentrate them in fewer wallets (causing further burning). . this dynamics have been tested in V1 and V2, and will most likely happen more and more as the circulating supply gets scarcer.
☑️ Money Players vs Airdrop Nickels: due to the nature of the Air Drop Smart contract (users who already had ETH at the block 8113050 are eligible for 150 SHUF tokens for every ETH that the user held at that time, up to a maximum of 1500 SHUF), most of the users entitled to SHUF Airdrop are most likely into the group of higher buying power (in Crypto terms) and less in the group of small Airdrop Enthusiasts. Many will probably claim and dump, but we expect that many more will find true value in this project and will engage into the SHUF dynamics in the long term.
☑️ At the end of the day, SHUF is just another social experiment, we are as curious as you, as where it will all go...
☑️ For Realtime Prices, Market Stats and Tokenomics data, please use our Shuffle Bot inside our Telegram Group.
🏦 SHUF Exchange Listing:
🦄 Uniswap (Swap) - https://uniswap.exchange/swap/0x3a9fff453d50d4ac52a6890647b823379ba36b9e
🌐 DDEX (DEX) - https://ddex.io/trade/SHUF-WETH
🌐 Bamboorelay (DEX) - https://bamboorelay.com/trade/SHUF-WETH
🔜 (New Exchange Listings Soon)
ℹ️ Frequently Asked Questions:
🔘 Who is eligible for the airdrop? Any user who already had ETH at the block 8113050 is eligible for 150 SHUF tokens for every ETH that the user held at that time.
🔘 Is there any cost? The only cost of claiming SHUF tokens is the gas of the claim transaction. The tokens are distributed for free.
🔘 Is there any minimum amount? No, you can claim even one single wei.
🔘 And is there a maximum amount? The maximum amount of tokens that a single address can claim is 1500 SHUF, equivalent of holding 10 ETH at the block 8113050.
🔘 How many SHUF tokens are there? The total amount of SHUF is one million and is bound to go down.
🔘 What happens if everybody tries to claim its SHUF? After all the 1,010,101 tokens are distributed, the airdrop is finished.
🔘 What is the heap? The heap is the data structure used to track the 512 top holders of the token; you can enter and leave the heap depending on how much balance do you have, and how much have the others.
🔘 What happens if I am in the heap? On every transaction, you are eligible to be the winner of the 1% of the amount transferred.
🔘 What is the SHUF transaction fee? Almost all transfers of SHUF tokens have a surcharge of 2%, half of the amount is going to be burned, and the other half is sent to a winner drawn from the heap.
🔘 What is burning tokens? When tokens are burned, they are no longer part of the total emission of SHUF token, this adds to its scarcity and increases the value of the remaining tokens.
🔘 How is the random winner selected? The address of the sender is used as the seed of the random number generator, and with that unique generator, the index of the winner is obtained. In this manner, we limit the ability of the sender to manipulate who is going to be the winner when they make a transfer.
🔘 What goes to the developer? We keep 6% of the token emission, and we are subject to the same fees as every other user, also we don't have any means to emit or manipulate the circulating tokens.
🔘 Is the project open source? Yes, you can find all the code in our Github repository.
🔘 What was the Project Launch date? 5th of August, 2019
🌐 Resources: Official Site: https://shuffle.monste CoinGecko: https://www.coingecko.com/en/coins/shuffle-monster Bitcoin Talk: https://bitcointalk.org/index.php?topic=5175327.msg52163947 Official Telegram: https://t.me/shuftoken Official Twitter: https://twitter.com/ShuffleToken Official GitHub: https://github.com/Agusx1211/shuffle Etherscan (Token): https://etherscan.io/token/0x3a9fff453d50d4ac52a6890647b823379ba36b9e Etherscan (Contract): https://etherscan.io/address/0x0515023dc5ab2a88713ab5a03011e56ea754ad6f#code
submitted by Shuffle_Monster to ShuffleMonster [link] [comments]

r/Bitcoin recap - September 2019

Hi Bitcoiners!
I’m back with the 33rd monthly Bitcoin news recap.
For those unfamiliar, each day I pick out the most popularelevant/interesting stories in Bitcoin and save them. At the end of the month I release them in one batch, to give you a quick (but not necessarily the best) overview of what happened in bitcoin over the past month.
You can see recaps of the previous months on Bitcoinsnippets.com
A recap of Bitcoin in September 2019
Adoption
Development
Security
Mining
Business
Education
Regulation & Politics
Archeology (Financial Incumbents)
Price & Trading
Fun & Other
submitted by SamWouters to Bitcoin [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]

How to understand this interview question?

About a year ago I signed up to a company that sent me the following interview question:

Develop a simple bitcoin realtime ticker JavaScript that shows in a single text line bitcoin value in Euro based on auto selection between 2 or more bitcoin price feeds and 2 and more currency rates feeds.
Feel free to use any feed you like. Completed code we expect to see in GitHub or BitBucket.
Example output line:
BTC/USD: 600 EUUSD: 1.05 BTC/EUR: 550 Active sources: BTC/USD (3 of 3) EUUSD (2 of 3)
Technical requirements.
The expected solution must handle feeds in parallel, consistently, work with isolated state, care of resources and shutdown the subscriber gracefully. It must also handle network latencies, frozen requests and corrupted data.
Business requirements.
Aggregate unlimited number of feeds.
Given every feed data expiration time, the solution must not use obsolete data in comparisons and calculations.
----
Hints:
How responsive is the solution to
1) the new price available in the feed?
2) program shutdown?
Is it possible to attach multiple tick viewers?
How does one of the broken feed affect ticker behaviour?
Do you understand the concept of Bid/Ask for the price?
How old data is you final ticker BTC/EUR giving out to end user?
What is the theoretical limit of feed sources in your solution?
Did you run build with -race detection?
Is it possible to test the solution without real access to the feed sources?

And I had a hard time understanding what's asked of me. Especially the following:

submitted by Sneakyturtle1337 to javascript [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]

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]

[Theme] Alt-Cryptocurrency Nerd's Amoled Homescreen

EDIT: Not sure why the preview is not showing up, thought I uploaded it directly. Here's the Imgur link
https://imgur.com/a/jqyJg
Just picked up the S8+ after nearly 2 years of owning the G4. What a gorgeous display!
So the homescreen is designed to give me nearly realtime updates on the 3 major alts I hold on the exchanges. If any of the prices had declined from a set time period, they would turn red instead of being green. You can touch an individual price and it will open up a more detailed graph. This app is a must have for any enthusiast. Bitcoin Ticker Widget
The separator lines I just added with KWGT and the logos above I added with KWGT as well.
The news widget is Chronus. I set up the news feed to display custom rss feeds from Crypto news sites as well as certain reddit subs. It rotates stories every 10 seconds (adjustable in app) and you can click any preview to take you to the full story or subreddit post.
The weather widget is a KWGT widget included in the Lines icon pack, there are also some other widgets included in that pack. I'll link to both the free and paid versions but only the paid has more icons and the widgets
Free, Paid
The background is the top post of all time from /Amoledbackgrounds:
submitted by fo0you to androidthemes [link] [comments]

Die rand is kak

So the bitcoin network starts off 2016 much stronger than it entered 2015. With over a billion $ in startup investment capital. It is crazy to realize that it is worth R111,415,577,100 in valuation (amount of coins multiplied by freemarket price) and this is just the beginning. Compare this to standard bank at R188,4B especially if you consider they are down about 40% in the past year where bitcoin is up 533% since 2013, and up 61% in the last 6 months.
1 bitcoin = R7404
Crazy you might say.. no. Go look up what quantitative easing is. Hint: The banks have been creating trillions, devaluing your savings.
Bitcoin's processing power is now at 832,017,286,000,000,000 SHA256 hashes per second. This is what work it requires to mine bitcoin, what makes it secure and why we trust it more than some database in someone's vault that they can go edit if they please. This is real measurable energy consumption. Almost like digging up gold, just more humane.
With 6 months left till the amount of new bitcoins mined halves to 12.5BTC per 10mins. We'll be entering the realm of sub 5% yearly monetary base inflation. This means instead of R788,400,000 worth of bitcoin created per month it will become only R394,200,000 worth per month newly issued. This new cycle will run for 4 years, like the last, before it halves again, and again. Until eventually in 140 years from now we have the last bit of bitcoin at 21million BTC. 21,000,000.000,000,000 should be enough for everyone.
I've used rands so people can understand the scale of this thing a bit better. The exchange rates change over time according to free markets.
Edit: I've added a list of links.. far from complete, but good enough to get started. I recommend south africans to use bitx market to exchange BTC/ZAR. Watch the links under knowledge in this list.
Wallets:
breadwallet iPhone bitcoin Android
more on bitcoin.org/en/choose-your-wallet
Exchanges:
bitx ZAR, MYR, NGN, KES, IDR kraken EUR, USD, CAD, GBP, JPY, LTC okcoin CNY, USD vaultoro XAU (gold) There are many more..
Useful services for south african bitcoin holders:
bitrefill Buy 8ta, cellc, mtn or vodacom airtime using bitcoin. takealot.com Buy things online for delivery, use instant eft then bitcoin on checkout. namecheap Domains for bitcoin.
Tools:
bitxZAR bitx market for south africans. bitcoinwisdom for seeing live exchange rates across many exchanges. cryptowatch has some other exchanges listed aswell and nice plotting tools. bitcointicker realtime market ticker. coinigy professional crypto trading platform (30 day free, 0.054BTC/mo) blockchain.info viewer, wallet provider and blockchain api blockr.io blockchain viewer and api bitpay easy bitcoin integration provider
Community
reddit/bitcoin reddit/btc bitcointalk forums bitcoin.com forum
Channel ##bitcoin on freenode irc server 
Knowledge:
bitcoin core sourcecode on github
bitcoin whitepaper by Satoshi Nakamoto (pdf)
Bitcoin, Freedom, and the Future of Finance? by Bhagwan Chowdhry, Professor of Finance at UCLA Anderson, joined us for an IDFC-U discussion in which he explained why he believes Bitcoin is just the beginning.
Wired 2015 Bitcoin by Andreas Antonopoulos
submitted by rende to southafrica [link] [comments]

Bitcoin Price Ticker using ESP8266 (ESP07) and NOKIA 5110 LCD Bitcoin Price Ticker Tutorial! Raspberry Pi & Python - YouTube DIY Cryptocurrency (Bitcoin) Ticker / Realtime Subscriber ... LED Bitcoin Price Ticker - Raspberry Pi Real Time Stock Price Scraping with Python and Beautiful ...

The Kitco Bitcoin price index provides the latest Bitcoin price in US Dollars using an average from the world’s leading exchanges. Bitcoin Ticker - Tick by tick, real time updates. All data is indicative. Fastest live cryptocurrency price & portfolio tracker with historical charts, latest coin markets from crypto exchanges, volume, liquidity, orderbooks and more! UA-109208733-1 Coins Trade Time; JPY/CHF: 0.8600-0.8700-0.04 %. 0.00. 07:54:00 PM. ... Dow Jones Gold Price Oil Price EURO DOLLAR CAD USD PESO USD POUND USD USD INR Bitcoin Price Currency Converter Exchange Rates ... Bitcoin USD price, real-time charts, bitcoin news and videos. Learn about BTC, crypto trading and more.

[index] [28209] [20133] [44418] [11099] [36983] [61549] [20378] [4434] [44627] [16195]

Bitcoin Price Ticker using ESP8266 (ESP07) and NOKIA 5110 LCD

Build a Desktop Arcade Machine with Raspberry Pi 3 and Retropie: Super Turbo Pro Edition - Duration: 27:15. Ryan Bates Recommended for you Keeping an eye on the price of bitcoin as it returns to the moon! :) This bitcoin ticker is displaying the CoinDesk BPI in GBP (updates every minute). Built using a Raspberry Pi - B+ with BelleVue ... This video covers how you can use python to do some webscraping. Using a simple example of capturing stock price data in real time, and updating it. Hopefull... Watch Bitcoin trade in real time as analysts discuss the key drivers behind the cryptocurrency's price and volatility. » Subscribe to CNBC TV: https://cnb.cx... Realtime Bitcoin, Ethereum, Litecoin Ticker - Live Price Monitor BTC ETH LTC Subscribe for 24/7 365 Bitcoin Ticker live on YouTube.

http://forex-thai.bitcoinminingsecrets.pw