Live data from Hacker News

Show HN: CashGraphs – A securities portfolio optimizer

cashgraphs.com

1–10 of 22 posts

Show HN: CashGraphs – A securities portfolio optimizer

#1
Hello,

This is a portfolio optimizer I made to help select portfolios for my clients. I'm a personal financial adviser. I generally put my clients in a mix of low-fee index funds and ETFs and I use this to set an appropriate allocation based on the client's risk tolerance.

I have been working on this as a side project to 1) improve the theoretical underpinnings of my investment recommendations and 2) improve my coding skills with frameworks like Vue and Torch. Here's the repository for the frontend: https://github.com/justinluther502/cashgraphfront.

The frontend site is Vue 2 + Vuetify, and the backend is an AWS lambda function running the Torch optimizer. I am still working out kinks in the backend, particularly cold-start issues because the Lambda function has to load the entire Torch library (~2GB). This occasionally causes the AWS API Gateway to reach max timeout before the Lambda function finishes. Any tips on addressing this would be much appreciated. My first thought is maybe to pare down the Torch library used in the Lambda function because I am only using a small subset of the full library.

The optimizer function itself is designed to overcome several classic shortcomings in Modern Portfolio Theory (MPT) (https://en.wikipedia.org/wiki/Modern_portfolio_theory). Unlike textbook implementations of MPT, this optimizer can utilize non-normal returns distributions, risk metrics besides variance, and can allow the user to specify tail behavior, such as asset correlations behaving normally most of the time but converging to 1.0 in severe downturns. Most of these "fixes" happen during the generation of custom "flavors", or asset selection universes. I have 3 flavors pre-built and there is some information on how they are constructed in the flavor selection page.

Any feedback greatly appreciated!

Justin Luther justinluther@lutherwealth.com https://www.lutherwealth.com

Show HN: CashGraphs – A securities portfolio optimizer
cashgraphs.com

Re: Show HN: CashGraphs – A securities portfolio optimizer

#2
Looks neat, but it's a bit unclear to me how to read the Pareto frontier graph. Also, would you share your references for the fixed you implemented/give recommendations for papers/books that can give useful domain knowledge to an ML person reading up on portfolio optimisation? I.e. the "actually useful" parts of the literature?

Re: Show HN: CashGraphs – A securities portfolio optimizer

#3
post #2

Looks neat, but it's a bit unclear to me how to read the Pareto frontier graph. Also, would you share your references for the fixed you implemented/give recommendations for papers/books that can give useful domain knowledge to an ML person reading up on portfolio optimisation? I.e. the "actually useful" parts of the literature?

Thanks for the feedback! I'll try to label the chart a little more clearly. The y axis is expected returns, the x axis is expected riskiness. I show the generated optimal portfolios alongside the original constituent assets that comprise the portfolios. So ideally you want a portfolio up and to the left, but higher-returning securities tend to be riskier.

I found the literature on vine copulas to be helpful, particularly the following presentation: https://www.birs.ca/workshops/2013/13w5146/files/Brechmann.p...

I used that as a helpful guide for ways to create some of the more interesting returns simulations.

Re: Show HN: CashGraphs – A securities portfolio optimizer

#5
The default portfolios are weird.

The Six Asset classic (the default) includes Japanese stocks, and Emerging Market Corporate bonds, but no other international assets?

The basic stock and bond includes only high yield bonds?

The 12 asset includes international stocks and international bonds but then specifically adds additional Canadian stocks and Canadian bonds on top of that?

Re: Show HN: CashGraphs – A securities portfolio optimizer

#6
post #5

The default portfolios are weird. The Six Asset classic (the default) includes Japanese stocks, and Emerging Market Corporate bonds, but no other international assets? The basic stock and bond includes only high yield bonds? The 12 asset includes international stocks and international bonds but then specifically adds additional Canadian stocks and Canadian bonds on top of that?

Yes that's definitely a struggle. There is a balancing act involved in getting a set of time series that share 1) a common methodology for calculating index levels and returns, 2) a long lookback period, 3) index levels that account for dividends, 4) freely available and relatively simple to download to csv or other useful format. St Louis FRED database was very useful in this regard. I could definitely make some nicer flavors by using a paid source for historical asset returns but I'm not willing to do that just yet.

The next flavor I make will probably use something from: http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_...

And for that one I'd like to use some non-normal distributions and other fancier characteristics.

Re: Show HN: CashGraphs – A securities portfolio optimizer

#7

How does this compare to mlfinlab?

I believe the idea with mlfinlab is for users to build and test models to predict asset returns. In other words, a tool to generate alpha. I may be wrong about this as I'm not familiar with mlfinlab.

CashGraphs is more oriented towards passive asset allocaters who want to pick a portfolio that has high expected returns for a given risk-tolerance level.

Re: Show HN: CashGraphs – A securities portfolio optimizer

#8
Idea to make it more user friendly to folks like myself who don't understand how your app is supposed to work:

Provide a UI layer which contains some instructions and points out features and their uses. Looking at the app, I don't quite know what I am supposed to do, or use it to figure out. Perhaps provide some example use cases or personas, alongside the UI layer of instructions.

Re: Show HN: CashGraphs – A securities portfolio optimizer

#9
Looks nice, but I'm confused how to read the Expected Returns y-axis. My assumption would be that's an annualized ROI, but it's displaying for instance that US Stocks return 0.7% ? Also no idea if Risk has any objective unit?

Running the 6 asset classic, it is slightly amusing that the result is essentially just a classic 70-30 stock/bond mix (risk dependent obviously), and the other 4 assets are Would be nice if you could include also representative ETFs of a given asset class (I assume they exist) to make the results more actionable.

Post reply on HN