In [ ]:
import pandas as pd, matplotlib.pyplot as plt
In [ ]:
#get currencies
cr=pd.read_html('https://coinmarketcap.com/exchanges/hitbtc/')[0]
cr=cr[1:]
cr['c']=[float(i[1:].replace(',','')) for i in cr[3]]
minvol=100000
currencys=cr[cr['c']>minvol][1].values
currencys
In [ ]:
cv=pd.read_json('https://api.coinmarketcap.com/v1/ticker/?limit=300')
In [ ]:
currencies=['bitcoin-cash','trackr','openanx','blackmoon-crypto','qtum','neo','stratis','bancor',\
'monetha','eos','nem']
currencies=cv['id'].values[1:]
exchanges=['HitBTC','Bittrex','COSS','WEX','Binance','Allcoin','LiteBit.eu','GDAX','EtherDelta']
df=[]
for c in currencies:
print c,
url='https://coinmarketcap.com/currencies/'+c+'/#markets'
df.append(pd.read_html(url)[0])
In [ ]:
best=[]
for j in range(len(currencies)):
curr='BTC'
d=df[j].loc[[i for i in df[j].index if df[j]['Source'][i] in exchanges]]
d=d.loc[[i for i in d.index if curr in d['Pair'][i]]]
d['p']=[float(i.replace('*','').strip()[1:]) for i in d['Price']]
d['v']=[float(i.replace('*','').strip()[1:].replace(',','')) for i in d['Volume (24h)']]
minvol=10000
d=d[d['v']>minvol].sort_values('p')
print j,
try:
best.append({"j":j,"vol(k)":min(d['v'].values[0],d['v'].values[-1])/1000.0,"cu":currencies[j],"v":d['p'].values[-1]*100/d['p'].values[0]-100,\
"sell":d['Source'].values[0],"buy":d['Source'].values[-1]})
except: pass
In [ ]:
pd.DataFrame(best).sort_values('v',ascending=False).head(10)
In [206]:
#speed 1-5
#EDG 25 min
#PPC 50 min
#DOGE 10 min
In [ ]: