US Equities and ETFs

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.

Equities

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.

Examples: python, R; Code: python, R

ETFs

In ETFsUs, you will find Meta that has a robust set of descriptive information like the reference index, AUM, launch-date, etc.

Examples: python, R; Code: python, R

Questions? Ask them over at our slack workspace. Can’t wait to see what you will invent with these!

Version 2.0

pluto is dead. long live pluto!

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

What’s new:

  • 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.
  • Dark mode!

Give it a spin on lab.pluto.studio and slack me if you need anything!

Fun with Fama-French

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.

Market returns in excess of risk-free rate

But shorter time horizons see their fair share of negative premia. i.e., bonds out-perform equities.

Market returns in excess of risk-free rate
Notebook on github: Equity-Risk-Premium.R

Value vs. Equal weighting

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:

Equal-weight
Value-weight

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.

Equal-weight
Value-weight

Once again, we see how value (market-cap) weighting vs. equal weighting impacts returns.

 Notebook on github: Industry-Returns.R

Low-momentum ≠ Negative-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!

Value-weight

Highlighting the importance of the portfolio weighing scheme, lo and behold the equal-weight returns:

Equal-weight

Making a list of stocks, in this case by sorting stocks based on prior returns, is only a small part of constructing a portfolio.

Notebook on github: Momentum-Decile-Performance.R

Long-Short comes up short

The last 10-years in the US markets have been a one-way, long-only bet. So if you constructed a long-short momentum portfolio, the chances are that you got hosed.

Value-weight

Long-short’s last hurrah was in 2009. It has a lot of catching up to do with long-only momentum.

 Notebook on github: Long-Short-Momentum.R

Out-lasting statistics

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.

Notebook on github: Momentum.R

Questions?

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!

Bangalore R User Group lands on pluto

why? what? how?

BRUG members had grown tired of me rant about the high barriers to entry for financial data analysis. I think they were just mostly relieved that they don’t have to hear me complain anymore 🙂

Jokes apart, it was a pleasure presenting to such a receptive crowd who had all gathered there to learn.

And if you are in Bangalore and want to get involved in the R community, check out BURG on Meetup for upcoming events!