Created
November 11, 2017 03:20
-
-
Save kanzitelli/94e95d97c5331b48a2c761e1e85b17a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aapl_amzn_dict = { 'AAPL': log_returns.AAPL, 'AMZN': log_returns.AMZN } | |
AAPL_AMZN_log_returns = pd.DataFrame.from_dict(aapl_amzn_dict) | |
fig = plt.figure(figsize=[16,9]) | |
ax = fig.add_subplot(2,1,2) | |
for c in AAPL_AMZN_log_returns: | |
ax.plot(AAPL_AMZN_log_returns.index, 100*(np.exp(AAPL_AMZN_log_returns[c].cumsum()) - 1), label=str(c)) | |
ax.set_ylabel('Total relative returns (%)') | |
ax.legend(loc='best') | |
ax.grid() | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment