Which US portfolios did best during the begin of the great inflation (and a shameless introduction to my new web app)
Hello fellow investors,
Yesterday I made my web app public under the link:
https://ken-french-data-explorer.streamlit.app
You might know portfoliovisualizer.com and similar sites which help you visualizing and analyzing existing strategies, ETFs, Stock and funds from different points of view. I love visualizing and analyzing quantitative investing strategies. Unfortunately, common websites like portfoliovisualizer.com stick to strategy ETFs and funds with limited history or factor asset classes which are mainly limited to size and value. A more comprehensive open-source database is given by Kenneth R. French which includes monthly US industry portfolio data and global factor strategy data (incl. momentum, buybacks, profitability, …), in some cases back to 1926. However, the database is not really user-friendly for a quick check. You always have to download the .csv files you need, clean and manipulate them in Excel or elsewhere (which can be really messy due to their “special” format) and have to analyze and plot by hand.
So I automatized the download, cleaning and binding of the data in one script and wrote a webapp to work with this new data .csv file. I mainly wrote the app for… well… myself. Too often, I did the same task over and over again for “just a quick check”, wasting an hour knitting everything together in Excel. So it just made sense to write an streamlit app for the task.
I will update the .csv file regularly and I will add features and further portfolio data from time to time. I am open for any suggestions, feature requests, bug reports or similar.
Example
So let’s say you want to check which US portfolios did best during the inflation of the 1970s.
First you can check what the overall market did during that period. Just select “Market_US” under “Macro” in the sidebar and click “Submit Selection”. Under “Return Mode” in the Main Page you can now choose between certain ways to calculate returns. Since we want to check for inflation, we choose “Real Return (ex US Inflation)”.
Note: “ex” data for the return mode (CPI_US in this case) does not have to be checked in the sidebar; only if you also want it to appear in the plots and tables for comparison.
Below the “Return Mode” field, you can choose the time frame to look at. From the cum. wealth chart. The 6-year period from December 1968 to December 1974 seems like a nice starting point:
Now let’s add other portfolios. To find out which US portfolios were the best, I will just select all Cap-Weighted > US Industry Portfolios & US Factor Portfolios. By clicking the node checkmark, all subfolders can be selected and unselected quickly. If you want to go more granular, just expand the subfolder nodes and select accordingly. You can compare any set of portfolios freely. Just be aware that selcetion of 100s of portfolios naturally will lead to lower performance of the application. When you made your new selection, just make sue to hit “Submit Selection” again.
Of course we selected A LOT of portfolios now, which makes the cum. wealth chart and the drawdown chart pretty messy. You can use the chart options to:
Look at the charts in full-screen
Zoom in and out
Hover over single lines to get information
Hide single lines
…
However, for the plots and charts, you should limit your portfolio selection to something like max. 30 portfolios.
However, if you scroll down further, you will also find a table for a quick overview of the stats of all chosen portfolios. Using the table tools you can expand to full-screen and sort the portfolios e.g. by CAGR. Let’s have a closer look at the top five portfolios by Sharpe Ratio.
The portfolio labels of industry portfolios are pretty intuitive (e.g. Tobacco_US_IND_vw) You can find the detailed industry definitions here.
The factor portfolio labels require some pre-knowledge about factors in general and -even better - the Ken R. French database. But even if you know nothing about it, you should quickly get behind it1.
Let’s now only select these top portfolios in the sidebar. Just for fun, let’s add in one of the worst portfolios for that period, High-Vol Microcaps. Et voilà:
Tobacco, Healthcare and Coal were able to hold up better against inflation during the first part of the period whereas mining stocks performed better in the second half. LARGE_LTR1, which means largecaps with the lowest return over the prior 60-12 months, meaning a largecap mean reversion startegy, also performed well, most likely due to lucky rotation in a volatile sideways market. For comparison, High-Vol microcaps (MICRO_VAR5) got absolutely destroyed.
I hope from this example, you are now excited to test the app on your own. If so, please test it on PC or Mac. It can be used on mobile but it’s not optimized for it and I wouldn’t recommend. Check out the sidebar to find intersting portfolios to compare. International data is available back to 1990ish and US back to 1920’s or 1960’s depending on specific factors selected.
Regions include:
Factors include:
Planned features:
Drawdown Length
Trend Backtests
Monte Carlo Simulations
Ratio Charts
Rolling Return Charts
much more…
Enjoy on https://ken-french-data-explorer.streamlit.app!
If you like the app it would be reeeeeeeeeeeeeeeeeeeeally nice of you to spread the word and share the link. For bug reports or feature requests, contact me here under
or on Twitter.The general factor portfolio label format is S_F_R_N_W with:
S… Size Bucket (MICRO, SMALL, MID, LARGE, MEGA)
F… Factor Bucket (see nodes in sidebar)
R… Region (see nodes in sidebar)
N… number of Size Buckets x number of Factor Buckets in that sort (5x5 or 2x3)
W… weighting scheme of portfolio (cap-weighted = vw; equal-weighted = ew)
So for example MICRO_MOM5_US_5x5_vw means a cap-weighted (vw) US microcap portfolio with the highest momentum (MOM5). The original sort this portfolio is part of is a sort of all US stocks into 25 portfolios based on 5 size buckets (MICRO to MEGAcaps) times 5 momentum buckets (lowest20% to highest20%). Portfolios rebalanced and reconstituted monthly.