<center> https://steemitimages.com/0x0/http://cryptogab.com/wp-content/uploads/2014/09/iiskg2.jpg </center> # TL;DR # I wanted to share with you all how to begin building an open-source platform for analyzing cryptocurrency market data. If you aren't a fan of getting your trading advice from platforms derived from traditional markets and are curious about building your own tools for forecasting and investing, I hope you'll read further and comment. All feedback is appreciated. # Free Datahz? # There are many APIs to choose from with more detailed options ... often with a price tag. I chose this API for a few reasons: * Free (for now?) * Historical Data for Many Alt-Coins * Easy of Use! (Thanks to http://coinmarketcap.northpole.ro) # Setup # <center>https://steemitimages.com/0x0/http://4.bp.blogspot.com/-1zFG4UY4gKg/UpzI685WlKI/AAAAAAAAIco/IHY2I3bmHeU/s1600/to+the+moon+meme+2.jpg </center> ### Get VBox ### https://www.virtualbox.org/wiki/Downloads ### Get ELK VM ### https://bitnami.com/redirect/to/151919/bitnami-elk-5.4.1-0-linux-debian-8-x86_64.ova ### Config ELK VM ### _Change Adapter 1 to Host-Only_ <center></center> _Enable Adapter 2 to NAT_ <center></center> _For Improved Performance, Adjust RAM/Processors/Etc._ <center></center> _Login with Defaults_ **bitnami/bitnami** (Change password) ### Enable ssh (this can be skipped but, I preferred ssh for this) ### sudo rm -f /etc/ssh/sshd_not_to_be_run sudo systemctl enable ssh sudo systemctl start ssh ### Install python + pip + elasticsearch.py ### sudo apt-get upgrade -y python-dev libssl-dev git-dev sudo python < <(curl -s https://bootstrap.pypa.io/get-pip.py) sudo pip install elastic search ### Check IP Address ### sudo ifconfig eth0 Link encap:Ethernet HWaddr de:ad:be:ef:ca:fe inet addr:192.168.100.101 Bcast:192.168.100.255 Mask:255.255.255.0 # Now we are ready to get going ... # <center>https://steemitimages.com/0x0/http://3.bp.blogspot.com/-xpJ5piAA6vQ/UpzI6GvaoXI/AAAAAAAAIcg/IIbdxoSQt8s/s1600/to+the+moon+meme.jpg</center> The basic workflow is like so: 1. Fetch JSON data from API 1. Parse JSON data 1. Configure elasticsearch index mapping to use the JSON object timestamp 1. Send result of parsed JSON data to elasticsearch This script can be saved to to something like chistory.py: #Imports import sys import datetime import requests import json from elasticsearch import Elasticsearch #Variables server = 'localhost' arg1 = sys.argv[1] arg2 = sys.argv[2] doctype = arg2.lower() id = arg1 #Send data to ELK function def sendtoelastic(data): try: es = Elasticsearch(server) es.index(index=id, doc_type=doctype, body=data) except Exception as e: print 'Error sending to elasticsearch: {0}'.format(str(e)) pass #Send settings to ELK function def settingselastic(data): try: es = Elasticsearch(server) es.indices.create(index=id, ignore=400, body=data) except Exception as e: print 'Error sending to elasticsearch: {0}'.format(str(e)) pass #Build request, download and load JSON data payload = {'coin': arg2, 'period': arg1} r = requests.get('http://coinmarketcap.northpole.ro/history.json?', params=payload) h = r.text d = json.loads(h)['history'] #Send settings settings = '''{"mappings": {''' + '"' + arg1 + '"' + ''': {"properties": {"timestamp": {"type": "date","format": "epoch_second"}}}}}''' settingselastic(settings) #Send data for i in d.items(): for l in i: if type(l) is dict: sendtoelastic(json.dumps(l)) ### **Usage:** ### python chistory.py 2017 BTC python chistory.py 2017 BTC;python chistory.py 2017 ETH;python chistory.py 2017 DOGE python chistory.py 2016 BTC;python chistory.py 2016 ETH;python chistory.py 2016 DOGE ### **Coins:** ### A current list of coins can be found [here](http://coinmarketcap.northpole.ro/coins.json) ### **Dumping Index:** ### If for any reason we aren't happy with the results, we can dump elastic like this: curl -XDELETE 'http://localhost:9200/_all' # Haz Datahs ... Now What? # <center> https://steemitimages.com/0x0/https://pbs.twimg.com/media/CEWFP8oWIAAFoaG.jpg </center> Here's a quick how-to visualize your data in Kibana with a few line graphs which may be of interest ... * Open your browser and go to http://192.168.100.101/elk (use IP address from above) (user/bitnami) * Create Index "201*" ### Create Visualization ### **__Change.1h x Date__** 1. Click the "Visualize" Button 1. Click "Create New Visualization" 1. Click "Basic Charts > Line" 1. Select Index "201*" 1. Click Drop Down Button for Y-Axis 1. Select Aggregation > "Sum" 1. Select Field > "change1h" <center>  </center> 1. Click "Select Buckets Type" > X-Axis 1. Select Aggregation > "Date Histogram" 1. Select Field > "timestamp" 1. Select Interval > "Daily" <center>  </center> 1. Click "Add Sub-Buckets" > "Split Series" 1. Sub-Aggregation > "Filters" 1. Filter 1 > "btc" 1. Filter 2 > "eth" 1. Filter 3 > "doge" <center>  </center> 1. Save **__Change.24h x Date__** 1. Change Y-Axis Field > "change24h" 1. Save 1. Change name Change.24h 1. Check "Save as a New Visualization" Option 1. Save **__Volume.EUR x Date__** 1. Change Y-Axis Field > "volume24.eur" 1. Save 1. Change name Volume.EUR 1. Check "Save as a New Visualization" Option 1. Save ### Create a Dashboard ### 1. Select Dashboard Button 1. Create New Dashboard 1. Add Visualizations to Dashboard  # On APIs # This is just a basic example of leveraging an API for analytics. The basic mechanics ought be able to be applied to other APIs of interest. If you'd like to see more API analytics, follow and up vote. I hope this helps someone! If you made it this far ... Thanks!
author | cayce |
---|---|
permlink | 5-min-diy-cryptocurrency-analytics-platform |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency","trading","bitcoin","money","beyondbitcoin"],"image":["https://steemitimages.com/0x0/http://cryptogab.com/wp-content/uploads/2014/09/iiskg2.jpg","https://steemitimages.com/0x0/http://4.bp.blogspot.com/-1zFG4UY4gKg/UpzI685WlKI/AAAAAAAAIco/IHY2I3bmHeU/s1600/to+the+moon+meme+2.jpg","https://steemitimages.com/DQmVJFgxN3miT8qVEoTjJZ2wEtFZT8DjL4CRWE6HPD8xLSx/1.png","https://steemitimages.com/DQmRJTMCEBYYz8SzpQaPpcfJS9oh62xUz4c5m5NzPMikyj1/2.png","https://steemitimages.com/DQmRksixxw8nkhxFMCFhN2WGCpkb5s6Esnd48JooG9x354k/3.png","https://steemitimages.com/0x0/http://3.bp.blogspot.com/-xpJ5piAA6vQ/UpzI6GvaoXI/AAAAAAAAIcg/IIbdxoSQt8s/s1600/to+the+moon+meme.jpg","https://steemitimages.com/0x0/https://pbs.twimg.com/media/CEWFP8oWIAAFoaG.jpg","https://steemitimages.com/DQmSnBy9EYyfB6fJxDLsBAsPugPckrveMVU19mtnT9Nhsh4/5.png","https://steemitimages.com/DQmUsaBEpDfHZRmJXU727yx8iAXpAzty2FoDJNGVdi8XwS2/6.png","https://steemitimages.com/DQmReuqK4DhELJAyaQyhsV4ueFiN9yuQeTRJDd1hxnvAAav/7.png","https://steemitimages.com/DQmcX1wK8BPKWKrHjvzZi6tiNfqocR8aejn9DJdjQrfpTz5/4.png"],"links":["http://coinmarketcap.northpole.ro","https://www.virtualbox.org/wiki/Downloads","https://bitnami.com/redirect/to/151919/bitnami-elk-5.4.1-0-linux-debian-8-x86_64.ova","http://coinmarketcap.northpole.ro/coins.json","http://192.168.100.101/elk"],"app":"steemit/0.1","format":"markdown"} |
created | 2017-07-02 11:01:03 |
last_update | 2017-07-02 14:12:51 |
depth | 0 |
children | 3 |
last_payout | 2017-07-09 11:01:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 7.239 HBD |
curator_payout_value | 2.301 HBD |
pending_payout_value | 0.000 HBD |
promoted | 1.000 HBD |
body_length | 6,573 |
author_reputation | 188,364,865,985 |
root_title | "DIY CryptoCurrency Analysis Platform: 5 Min" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 6,998,415 |
net_rshares | 1,241,715,414,068 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
kryptik | 0 | 55,503,203,976 | 100% | ||
someguy123 | 0 | 631,032,943,259 | 100% | ||
morantis | 0 | 208,768,119 | 100% | ||
denno | 0 | 621,340,000 | 100% | ||
twistychips | 0 | 2,875,321,273 | 100% | ||
kimterje83 | 0 | 0 | 100% | ||
randowhale1 | 0 | 549,023,669,797 | 3.6% | ||
cayce | 0 | 0 | 0% | ||
yunkzilla | 0 | 2,253,149,511 | 100% | ||
satchmo | 0 | 197,018,133 | 100% | ||
duytruongnguyen | 0 | 0 | 100% |
This post received a 3.6% upvote from @randowhale thanks to @cayce! For more information, [click here](https://steemit.com/steemit/@randowhale/introducing-randowhale-will-you-get-the-100-vote-give-it-a-shot)!
author | randowhale |
---|---|
permlink | re-5-min-diy-cryptocurrency-analytics-platform-20170707t174248 |
category | cryptocurrency |
json_metadata | "{"format": "markdown", "app": "randowhale/0.1"}" |
created | 2017-07-07 17:42:48 |
last_update | 2017-07-07 17:42:48 |
depth | 1 |
children | 0 |
last_payout | 2017-07-14 17:42:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 209 |
author_reputation | 47,657,457,485,459 |
root_title | "DIY CryptoCurrency Analysis Platform: 5 Min" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,668,760 |
net_rshares | 0 |
Will this api be able to provide the bid spread in a baseline 0 graph as opposed to what is currently displayed by the crypto exchanges. May be able to get a better read on momentary momentum.
author | satchmo |
---|---|
permlink | re-cayce-5-min-diy-cryptocurrency-analytics-platform-20170707t204152877z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-07 20:41:51 |
last_update | 2017-07-07 20:41:51 |
depth | 1 |
children | 1 |
last_payout | 2017-07-14 20:41:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 192 |
author_reputation | 23,814,567,013,472 |
root_title | "DIY CryptoCurrency Analysis Platform: 5 Min" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,685,098 |
net_rshares | 1,168,707,566 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
cayce | 0 | 1,168,707,566 | 100% |
I'm not really clear on all those buzz words but, I'll try to explain further ... This is collecting raw data from the API: * Date * Position * Name * Symbol * Category * MarketCap x (usd,btc,eur,cny,gbp,cad,rub,hkd,jpy,aud) * Price x (usd,btc,eur,cny,gbp,cad,rub,hkd,jpy,aud) * AvailableSupply * Volume24h x (usd,btc,eur,cny,gbp,cad,rub,hkd,jpy,aud) * Change1h * Change24h * Change7d * Timestamp From this point, users/traders/gamblers can begin performing quantitative analysis as we see fit.
author | cayce |
---|---|
permlink | re-satchmo-re-cayce-5-min-diy-cryptocurrency-analytics-platform-20170707t212115438z |
category | cryptocurrency |
json_metadata | {"tags":["cryptocurrency"],"app":"steemit/0.1"} |
created | 2017-07-07 21:21:15 |
last_update | 2017-07-07 21:21:15 |
depth | 2 |
children | 0 |
last_payout | 2017-07-14 21:21:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 497 |
author_reputation | 188,364,865,985 |
root_title | "DIY CryptoCurrency Analysis Platform: 5 Min" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,688,354 |
net_rshares | 0 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
kimterje83 | 0 | 0 | 100% |