Given your current portfolio value, desired allocation after rebalancing, and the amount of cash you have, this script will output how much of your cash should be used to buy stock/bonds (in percent). Only works for portfolios with two funds, e.g. the Couch Potato and classic two-funds 60-40 portfolios. -
View it on GitHub