The US markets are the biggest in the world. We now have a meaningful subset of their equity and ETF market data on pluto.
Equities are under the EquitiesUs module and ETFs under the ETFsUs module on both python and R.
In EquitiesUs, you will find Tickers to have a list of equity symbols with their names and most recent market cap. This can be augmented with SecMeta which has the industry classification code for each. SecFilings has links to a company’s regulatory filings.
End-of-day adjusted prices can be obtained through querying EodAdjustedTimeSeries.
The first version of pluto had a big WTF factor that threw most users off: everything was batch processed. pluto v1.0 bypassed Jupyter’s execution engine and sent the entire notebook to the back-end which then recomputed the whole thing and sent it back. The intuition behind this approach was that it was easier to bring code to data than data to code. But this was not how must users worked on notebooks. Most split their code into “data-load” and “analysis” blocks – load all the data first in the beginning and then iteratively code up the analysis blocks. Batching this lead to longer dev times. Hence, 2.0
Jupyterlab interface – sets pluto up for further enhancements.
Traditional dev cycle – no more batch processing.
Notebooks are not automatically uploaded to github – users can do this by logging into the terminal.
SSL – users can now work knowing that their comms are secure.
The Fama-French data-set is a great free resource for budding financial data-scientists. They have already gone through the trouble of cleaning, slicing and dicing the CRSP library so that you can get some high-level analysis done. At the time of writing this blog, pluto automatically updates the following US centric data-sets:
If you need a new data-set added, just raise an issue on github.
Here are some interesting things I found while exploring them.
Equity Risk Premium fluctuates
An equity investor takes on a lot more risk compared to someone who buys only US government bonds. So, in theory, the equity investor should earn returns in excess of those given by bonds. But how much more should that be?
Turns out, over a 20-year period, it adds up to quite a bit.
But shorter time horizons see their fair share of negative premia. i.e., bonds out-perform equities.
Suppose you want to build a portfolio out of a set of stocks. How much of each, as a percentage of the total portfolio, should you buy? The two most popular “weighting” schemes are value (market-cap) weight and equal weight. In the former, large market-cap stocks are held at a proportionally higher quantity in the portfolio. Whereas in the latter, each stock is held in equal proportion.
The decision between value weighting and equal weighting a portfolio cannot be taken in haste. It ends up making a big difference over time. We created a notebook that, among other things, sorts industries based on standard-deviations of 5-year returns. Portfolio weighting had a significant impact on overall returns:
Under equal weight, the best performing industry returns was twice as much as that of value weighted.
It is not all about Tech stocks
Depending on how you weight the stocks in your portfolio, software is not the only game in town. A lot of other industries (Lab Equipment, anyone?) have done better.
Once again, we see how value (market-cap) weighting vs. equal weighting impacts returns.
Sometimes, everything rallies. Just because a set of stocks performed poorly in the past doesn’t necessarily mean that they will have negative returns going-forward.
The Fama-French data-set has returns for portfolios constructed out of each decile of prior returns. Labeled LO_PRIOR, PRIOR_2..9 and HI_PRIOR, they represent portfolios who’s prior returns were the lowest through to the highest. You would think that LO_PRIOR returns would be a disaster compared to HI_PRIOR’s and the in-betweeners would lie on a spectrum. Not so!
Highlighting the importance of the portfolio weighing scheme, lo and behold the equal-weight returns:
Making a list of stocks, in this case by sorting stocks based on prior returns, is only a small part of constructing a portfolio.
Just because momentum is statistically shown to out-perform the market over long periods of time, the actual period during which it out-performs may not overlap with your time horizon. For example, 10-year factor premia ending 2010 through 2019 was actually negative. Most investors would have abandoned the strategy long before it could reclaim lost ground.
I hope this post left you with more questions than answers. pluto was built so that you can begin to explore the answers to those questions without getting your hands (too) dirty. The notebooks should be a good jumping off point. Log in, copy-paste and fire away! If you need help, slack me!