Skip to content

Commit

Permalink
Merge pull request boknows#11 from alistair-marshall/bonds-first
Browse files Browse the repository at this point in the history
Bonds first & OmegaNot
  • Loading branch information
alistair-marshall authored Mar 8, 2020
2 parents 8be2ea0 + 434af47 commit 23ae57e
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 3 deletions.
6 changes: 4 additions & 2 deletions faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,12 @@ <h3 class="panel-title">Portfolio Section</h3>
<ul>
<li><b>Portfolio Value:</b> Your total investable assets. Include all accounts where stocks, bonds, and cash instruments might reside. Do not include pensions, social security, house equity or other income streams in this number.</li>
<li><b>Initial Assets:</b> This is the asset allocation of your portfolio as of today. You can choose any mixture of Equities, Bonds, Gold, and Cash. <b>Please note: Gold prices were unchanged for a large period of time in the 1800's. Take this into consideration for the simulations.</b> Since there is no reliable historical data on cash investments (that I can find), the Growth of Cash input is for the user to determine how much growth over time that your cash allocation receives. As a default, it is set to 0.25%, an average value for a savings account at the credit unions in my area. Fees represent the maintenance/administrative fees that your portfolio requires. This number is calculated against your entire portfolio each year, so please use an average number across all accounts.</li>
<li><b>Rebalance Annually:</b> There are three options available,
<li><b>Annual Rebalancing Strategy: </b> These are a selection of strategies that can be used to adjust the allocation over time. There are three options available,
<ul><li><b>None</b> Your portfolio will drift to different percentages depending on how each asset class performs.</li>
<li><b>Constant</b> Your portfolio will automatically rebalance each year to match your initially chosen asset allocation.
<li><b>Constant</b> Your portfolio will automatically rebalance each year to match your initially chosen asset allocation.</li>
<li><b>Glide Path</b> You will choose a target allocation that is different from your initial one (For example, you want to go from 80%/20% stocks/bonds to 60%/40% stocks and bonds in retirement). You will then choose a "Start Year" and "End Year" to execute this allocation change. Your allocation will slowly change to the target allocation over the course of those years.</li>
<li><b>Bonds First</b> Annual spending is taken from the bonds portion, leaving the equities portion allone, until all the bonds have been used up. Then the equities are spent. The actual order is Cash > Gold > Bonds > Equities.</li>
<li><b><a href="http://daveleemn.tripod.com/omega_strategy.htm">OmegaNot</a></b> Annual spending is taken from the equities portion as long as the equities are worth as much as or better than their initial inflation adjusted value. Otherwise the spending is taken from the bonds/gold/cash portion.</li>
</ul>
</li>
</ul>
Expand Down
10 changes: 9 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ <h1 class="text-center">The Crowdsourced FIRE Simulator (cFIREsim) - Open Source
<div class="col-md-6">
<div class="form-group">
<label>
Rebalance Annually:
Annual Rebalancing Strategy:
<select class="form-control"
ng-model="data.portfolio.rebalanceAnnually"
ng-change="refreshRebalanceAnnuallyOptions()"
Expand Down Expand Up @@ -1627,6 +1627,14 @@ <h4 class="modal-title">Save Simulation Inputs</h4>
{
text: 'Glidepath',
value: 2
},
{
text: 'Bonds First',
value: 3
},
{
text: 'OmegaNot',
value: 4
}]
$scope.spendingPlanTypes = [{
text: 'Inflation Adjusted',
Expand Down
68 changes: 68 additions & 0 deletions js/cFIREsimOpen.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,74 @@ var Simulation = {
ret.gold = form.portfolio.targetPercentGold / 100;
ret.cash = form.portfolio.targetPercentCash / 100;
}
break;
case 3: //Bonds First (Cash>Gold>Bonds>Equities)
if (j>0){
var prev = j - 1;
var pot = {
'equities': this.sim[i][prev].equities.end,
'bonds': this.sim[i][prev].bonds.end,
'gold': this.sim[i][prev].gold.end,
'cash': this.sim[i][prev].cash.end
}
var change = this.sim[i][j].sumOfAdjustments - this.sim[i][j].spending
pot.cash = pot.cash + change
if (pot.cash < 0){
pot.gold = pot.gold + pot.cash
pot.cash = 0
}
if (pot.gold < 0){
pot.bonds = pot.bonds + pot.gold
pot.gold = 0
}
if (pot.bonds < 0){
pot.equities = pot.equities + pot.bonds
pot.bonds = 0
}
ret.equities = pot.equities / (this.sim[i][j].portfolio.start);
ret.bonds = pot.bonds / (this.sim[i][j].portfolio.start);
ret.gold = pot.gold / (this.sim[i][j].portfolio.start);
ret.cash = pot.cash / (this.sim[i][j].portfolio.start);
} else {
ret.equities = form.portfolio.percentEquities / 100;
ret.bonds = form.portfolio.percentBonds / 100;
ret.gold = form.portfolio.percentGold / 100;
ret.cash = form.portfolio.percentCash / 100;
}
break;
case 4: //OmegaNot
if (j>0){
var prev = j - 1;
var targetvalues = {
"equities": this.sim[i][j].cumulativeInflation* form.portfolio.initial * form.portfolio.percentEquities / 100,
"safe": this.sim[i][j].cumulativeInflation* form.portfolio.initial * (100-form.portfolio.percentEquities) / 100,
};
var currentequities
var totalsafe = this.sim[i][prev].bonds.end + this.sim[i][prev].gold.end + this.sim[i][prev].cash.end
if (this.sim[i][prev].equities.end > targetvalues.equities){ // equities are doing well
// remove spending from equities
currentequities = this.sim[i][prev].equities.end - this.sim[i][j].spending + this.sim[i][j].sumOfAdjustments
} else { // equities are doing poorly
// leave equities alone
currentequities = this.sim[i][prev].equities.end
// remove spending from other assets
totalsafe = totalsafe - this.sim[i][j].spending + this.sim[i][j].sumOfAdjustments
if (totalsafe < 0){
// ran out of safe assets, need to spend equities anyway.
currentequities = currentequities + totalsafe
totalsafe = 0
}
}
ret.equities = currentequities / this.sim[i][j].portfolio.start;
ret.bonds = totalsafe * form.portfolio.percentBonds / (this.sim[i][j].portfolio.start * (100- form.portfolio.percentEquities));
ret.gold = totalsafe * form.portfolio.percentGold / (this.sim[i][j].portfolio.start * (100- form.portfolio.percentEquities));
ret.cash = totalsafe * form.portfolio.percentCash / (this.sim[i][j].portfolio.start * (100- form.portfolio.percentEquities));
} else {
ret.equities = form.portfolio.percentEquities / 100;
ret.bonds = form.portfolio.percentBonds / 100;
ret.gold = form.portfolio.percentGold / 100;
ret.cash = form.portfolio.percentCash / 100;
}
}
return ret;
},
Expand Down

0 comments on commit 23ae57e

Please sign in to comment.