Black Lives Matter. Please consider donating to Black Girls Code today.

Show and Tell: Easy Financial Planning

My very first app here.
https://quantview.herokuapp.com

This app will help users by simplifying the retirement planning process down to a core set of five questions and then present the broad contours of how your wealth will grow and whether your money will be able to last you for the rest of your life.

Blog post also:

8 Likes

Wow, beautiful design!! Here is some screenshots for those just passing through. I really really like the suggestions / scenarios section at the bottom. Thanks for sharing, I’ll have to share this with a few of my friends :slightly_smiling_face:

2 Likes

That looks amazing! Really nicely done, very pleasant UI yet extremely complete and structured.

Have you tried posting it to reddit.com/r/personalfinance? I think the folks there would love it.

1 Like

Yes, I’m going to post it to reddit next. Thanks for the feedback!

1 Like

Very nice , looks great, how did you do predictive graph any tips ?

Hi, happy to share. Here’s the GitHub:

I assume you are asking how I project wealth into the future using market returns, savings and spending:

  • I generate a random market return for every year of the user’s life. This is just generating a random number (in my case I’m using a mean of 0.08 and standard deviation of .14).

  • If a user is expected to live another 60 years, that’s 60 random numbers and that represents a possible future for the user.

  • I then construct 10,000 of these possible futures. In effect this constructs an array with 10,000 sub-arrays and each of these subarrays is composed of 60 random stock market returns. This is called a Monte Carlo simulation. It can easily be accomplished using the numpy python library: np.random.normal(mean, stdev, size=[num_simulations, periods]) (see random_walk_simulations() in functions.py)

  • Similarly I then construct a 10,000 x 60 matrix (array) containing information about user savings in each year, another matrix for user spending, another matrix for social security payments, allocation between stocks/bonds, etc.

  • then it’s just a matter of combining all these matrices together. See the calc_wealth_trajectory() function for this logic. I’m going to take the wealth in the prior period and calculate the wealth in the current period by multiplying the prior wealth by the current market return (incorporating the stock return/bond return) and then adding/subtracting the user’s savings/spending.

  • the end result is a 10,000 x 60 matrix where each element represents the wealth at that point in time in a possible future. From there you can calculate at time t what the 50th percentile is for wealth (expected scenario), of the 5th percentile (pessimistic scenario). See wealth_distributions() for this logic.

But if you’re asking how I created the chart itself, then that’s easy too. See line 382-516 of apps/home.py

1 Like

Thanks a lot for sharing this!

@xhlu, I actually got banned from that subreddit when I tried to post. They say it violates their rules against “promotion”. Lame. Oh well, thanks again for the feedback.

1 Like

I’m sorry about that. It is indeed pretty odd, but I’m sure people will love this work on other platforms!