siavashadpey / rebalance

A portfolio rebalancing tool.
https://rebalance.readthedocs.io/
32 stars 11 forks source link

How use to optimize withdrawals? #22

Closed markuskhouri closed 7 months ago

markuskhouri commented 1 year ago

This is a straightforward-to-use solution to aid during the accumulation phase, where funds are being added to a portfolio. Can you speculate on what changes would be required to utilize this solution when funds are withdrawn from a portfolio as part of the deaccumulation phase, e.g., during retirement?

Putting a negative value in the cash_amounts variable (to indicate how much cash should be withdrawn from the portfolio) resulted in an error in the SLSQP Optimizer which stated that the lower bound was greater than the upper bound.

siavashadpey commented 1 year ago

I didn’t try it out but I think you would need to change the bounds of the optimization problem. Right now there is a lower bound constraint by 0 (i.e. no negative values can occur). You would need to put an upper bound of 0 instead and a lower bound of max amount of money you want to pull out (its negative value though). You might also have to change the way the solution of the optimization problem (which is in units of cash) is converted to units of stocks, if it assumes that the solution is positive (I forget if this is the case).