January 2020
Beginner to intermediate
432 pages
11h 24m
English
Execute the following code to plot Microsoft's stock prices together with the simple and log returns.
fig, ax = plt.subplots(3, 1, figsize=(24, 20), sharex=True)df.adj_close.plot(ax=ax[0])ax[0].set(title = 'MSFT time series', ylabel = 'Stock price ($)') df.simple_rtn.plot(ax=ax[1])ax[1].set(ylabel = 'Simple returns (%)')df.log_rtn.plot(ax=ax[2])ax[2].set(xlabel = 'Date', ylabel = 'Log returns (%)')
Executing the preceding code results in the following plot:

The resulting plot contains three axes. Each one of them presents a different series: raw prices, simple returns, and log returns. Inspecting the plot in such ...
Read now
Unlock full access