Portfolio Rebalance Calculator Formula
Understand the math behind the portfolio rebalance calculator. Each variable explained with a worked example.
Formulas Used
Stocks: Buy/Sell
stocks_trade = total_value * (target_stocks - stocks_pct) / 100Bonds: Buy/Sell
bonds_trade = total_value * (target_bonds - bonds_pct) / 100Cash: Add/Remove
cash_trade = total_value * (target_cash - cash_pct) / 100Total Rebalance Volume
total_trades = abs(total_value * (target_stocks - stocks_pct) / 100) + abs(total_value * (target_bonds - bonds_pct) / 100) + abs(total_value * (target_cash - cash_pct) / 100)Variables
| Variable | Description | Default |
|---|---|---|
total_value | Total Portfolio Value(USD) | 100000 |
stocks_pct | Current Stock Allocation(%) | 70 |
bonds_pct | Current Bond Allocation(%) | 25 |
cash_pct | Current Cash Allocation(%) | 5 |
target_stocks | Target Stock Allocation(%) | 60 |
target_bonds | Target Bond Allocation(%) | 30 |
target_cash | Target Cash Allocation(%) | 10 |
How It Works
Portfolio Rebalancing
Rebalancing restores your portfolio to its target allocation after market movements cause drift.
Why Rebalance?
How to Rebalance
Trade Amount = Portfolio Value x (Target% - Current%) / 100
Positive values mean buy; negative values mean sell.
When to Rebalance
Worked Example
$100,000 portfolio: 70% stocks, 25% bonds, 5% cash. Target: 60/30/10.
total_value = 100000stocks_pct = 70bonds_pct = 25cash_pct = 5target_stocks = 60target_bonds = 30target_cash = 10
- 01Stocks: sell $100,000 x (60% - 70%) = -$10,000
- 02Bonds: buy $100,000 x (30% - 25%) = +$5,000
- 03Cash: add $100,000 x (10% - 5%) = +$5,000
- 04Total volume = $10,000 + $5,000 + $5,000 = $20,000
Ready to run the numbers?
Open Portfolio Rebalance Calculator