/lazy_rebalance

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

lazy_rebalance

This is a python reimplementation of the "Optimal lazy portfolio rebalancing calculator" on http://optimalrebalancing.tk/index.html.

What it does

From the original website:

When contributing, use this calculator to help you purchase under-weighted assets optimally using only the contributed amount so that you get as close as possible to your target allocation without selling anything. Similarly, if you are withdrawing from your portfolio, use this calculator to help you sell over-weighted assets optimally to yield the desired withdrawal while getting as close as possible to your target allocation without purchasing anything.

Why python?

The source code for that calculator is licensed under the GPL but it is only provided in minified-JavaScript form, which was pretty hard for me to understand.

Rewriting it in python was how I understood what it is actually doing.