#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().run_line_magic('matplotlib', 'inline') import numpy as np import pandas as pd import matplotlib.pyplot as plt import poloniex import time import talib as ta import seaborn as sns # In[2]: polo = poloniex.Poloniex() polo.timeout = 2 # In[3]: btc_price = polo.marketChart('USDT_BTC', period=polo.DAY, start=time.time() - polo.DAY * 90 , end=time.time()) btc_close = [btc_price[i]['close'] for i in range(len(btc_price))] # In[4]: eth_price = polo.marketChart('USDT_ETH', period=polo.DAY, start=time.time() - polo.DAY * 90 , end=time.time()) eth_close = [eth_price[i]['close'] for i in range(len(eth_price))] # In[5]: xmr_price = polo.marketChart('USDT_XMR', period=polo.DAY, start=time.time() - polo.DAY * 90 , end=time.time()) xmr_close = [xmr_price[i]['close'] for i in range(len(xmr_price))] # In[6]: etc_price = polo.marketChart('USDT_ETC', period=polo.DAY, start=time.time() - polo.DAY * 90 , end=time.time()) etc_close = [etc_price[i]['close'] for i in range(len(etc_price))] # In[7]: xrp_price = polo.marketChart('USDT_XRP', period=polo.DAY, start=time.time() - polo.DAY * 90 , end=time.time()) xrp_close = [xrp_price[i]['close'] for i in range(len(xrp_price))] # In[8]: df = pd.DataFrame({'BTC':btc_close,'ETH':eth_close,'XMR':xmr_close,'ETC':etc_close,'XRP':xrp_close}) # In[9]: change = df.pct_change() # In[10]: change.describe() # In[11]: change.plot() # In[12]: sns.jointplot('BTC', 'ETH', change) # In[13]: sns.jointplot('BTC', 'XMR', change) # In[14]: sns.jointplot('BTC', 'ETC', change) # In[15]: sns.jointplot('BTC', 'XRP', change) # In[16]: sns.jointplot('ETH', 'XRP', change) # In[ ]: