%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
/Users/maedanaoki/.pyenv/versions/3.5.1/envs/test/lib/python3.5/site-packages/IPython/html.py:14: ShimWarning: The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`. "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)
polo = poloniex.Poloniex()
polo.timeout = 2
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))]
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))]
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))]
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))]
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))]
df = pd.DataFrame({'BTC':btc_close,'ETH':eth_close,'XMR':xmr_close,'ETC':etc_close,'XRP':xrp_close})
change = df.pct_change()
change.describe()
/Users/maedanaoki/.pyenv/versions/3.5.1/envs/test/lib/python3.5/site-packages/numpy/lib/function_base.py:3834: RuntimeWarning: Invalid value encountered in percentile RuntimeWarning)
BTC | ETC | ETH | XMR | XRP | |
---|---|---|---|---|---|
count | 89.000000 | 89.000000 | 89.000000 | 89.000000 | 89.000000 |
mean | 0.002887 | -0.010897 | 0.000404 | 0.016741 | 0.004851 |
std | 0.014124 | 0.053486 | 0.028041 | 0.127651 | 0.065610 |
min | -0.027844 | -0.189386 | -0.060153 | -0.131021 | -0.199798 |
25% | NaN | NaN | NaN | NaN | NaN |
50% | NaN | NaN | NaN | NaN | NaN |
75% | NaN | NaN | NaN | NaN | NaN |
max | 0.059739 | 0.225876 | 0.094858 | 0.808490 | 0.485570 |
change.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x10e32c358>
sns.jointplot('BTC', 'ETH', change)
<seaborn.axisgrid.JointGrid at 0x10e3c65f8>
sns.jointplot('BTC', 'XMR', change)
<seaborn.axisgrid.JointGrid at 0x10e754b38>
sns.jointplot('BTC', 'ETC', change)
<seaborn.axisgrid.JointGrid at 0x10ea4cc18>
sns.jointplot('BTC', 'XRP', change)
<seaborn.axisgrid.JointGrid at 0x10ed4b198>
sns.jointplot('ETH', 'XRP', change)
<seaborn.axisgrid.JointGrid at 0x10efc26d8>