In [6]:
import pandas as pd
import matplotlib.pyplot as plt

%matplotlib inline

In [10]:
perf = pd.read_pickle('./results.pickle') # read in perf DataFrame
perf.head()


Out[10]:
ETH algo_volatility algorithm_period_return alpha benchmark_period_return benchmark_volatility beta capital_used ending_cash ending_exposure ... short_exposure short_value shorts_count sortino starting_cash starting_exposure starting_value trading_days transactions treasury_period_return
2016-01-01 23:59:00+00:00 0.918 NaN 0.000000e+00 NaN 0.000000 NaN NaN 0.000000 1.000000e+07 0.000 ... 0 0 0 NaN 1.000000e+07 0.000 0.000 1 [] 0.0227
2016-01-02 23:59:00+00:00 0.956 0.000000e+00 0.000000e+00 NaN 0.000000 NaN NaN 0.000000 1.000000e+07 0.000 ... 0 0 0 NaN 1.000000e+07 0.000 0.000 2 [] 0.0227
2016-01-03 23:59:00+00:00 0.960 9.600184e-07 -1.047466e-07 NaN 0.000000 NaN NaN -10.647466 9.999989e+06 9.600 ... 0 0 0 -9.165151 1.000000e+07 0.000 0.000 3 [{'amount': 3, 'dt': 2016-01-03 09:00:00+00:00... 0.0227
2016-01-04 23:59:00+00:00 0.962 9.301440e-07 -2.027499e-07 NaN -0.015304 NaN NaN -1.962033 9.999987e+06 10.582 ... 0 0 0 -11.218769 9.999989e+06 9.600 9.600 4 [{'amount': 1, 'dt': 2016-01-04 23:29:00+00:00... 0.0224
2016-01-05 23:59:00+00:00 0.939 8.254251e-07 -2.280629e-07 -0.000009 -0.013322 0.194371 0.000004 -3.756130 9.999984e+06 14.085 ... 0 0 0 -11.115408 9.999987e+06 10.582 10.582 5 [{'amount': 2, 'dt': 2016-01-05 19:12:00+00:00... 0.0225

5 rows × 39 columns


In [11]:
ax1 = plt.subplot(211)
perf.portfolio_value.plot(ax=ax1)
ax1.set_ylabel('portfolio value')
ax2 = plt.subplot(212, sharex=ax1)
perf.ETH.plot(ax=ax2)
ax2.set_ylabel('ETH stock price')


Out[11]:
<matplotlib.text.Text at 0x113168630>

In [ ]: