[HN Gopher] Show HN: CashGraphs - A securities portfolio optimizer
___________________________________________________________________
Show HN: CashGraphs - A securities portfolio optimizer
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
Author : justinluther
Score : 49 points
Date : 2022-07-16 15:01 UTC (7 hours ago)
(HTM) web link (www.cashgraphs.com)
(TXT) w3m dump (www.cashgraphs.com)
| igorkraw wrote:
| 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?
| justinluther wrote:
| 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.
| anewpersonality wrote:
| How does this compare to mlfinlab?
| justinluther wrote:
| 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.
| ac29 wrote:
| 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?
| justinluther wrote:
| 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.
| 1autodev wrote:
| 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.
| justinluther wrote:
| Thanks for the suggestion! Right now I have attempted to do
| what you are describing, but the user has to click OK on the
| initial "welcome" dialog box to get stepped through the tour.
| If you click outside of the box to close it, you skip the tour.
| Definitely something to improve.
| cudgy wrote:
| On mobile, the instructions when first loading block the
| screen, making it more difficult to follow. Maybe a simple,
| quick video showing a few scenarios would be easier to
| follow?
| justinluther wrote:
| I agree! A video could definitely help, and I will try to
| change the display of the instructions on small screens.
| mNovak wrote:
| 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 <5% of
| portfolio.
|
| 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.
| justinluther wrote:
| Thanks for your feedback! This is on my to-do list of things to
| fix-- some of the flavors have been developed using monthly
| returns and some use annual. In both cases the x axis is
| variance of the periodic returns. Also in some cases the
| returns are log returns which is also a todo. I will fix it so
| that the x axis is labeled with the user's choice of risk
| metric used by the optimizer. Also, I should have mentioned it,
| but the risk choice isn't implemented in the backend yet so the
| risk metric choice just defaults to variance for right now.
| readme wrote:
| please keep working on this
|
| i suspect it's not going to be free for very long
|
| if it remains open source there's something no other fintech app
| has
| justinluther wrote:
| Thanks very much for the kind words!
___________________________________________________________________
(page generated 2022-07-16 23:01 UTC)