Skip to main content

Dollar Cost Averaging Investing Data Calculation

This tool calculates dollar cost averaging investing related data.

Choose the item to be calculated:
  FV          Sum
Monthly investments:
 dollar(s)
Time:
 year(s)
Annually rate of return:
 %
Future value of all monthly investments:
 dollar(s)
.

The following Chart shows the power of compouding effect.

Only the rate of return can not be factured out, so I used approximation which has the following JS code.

//time is in month and rate is in monthly rate.
function getrate(monthlyamount,futurevalue,time){
 var rate = 0.01;
 var change = 0.01;
 var estimaed;
 var diff;
    do {
	estimaed = (monthlyamount*(Math.pow((1 + rate),time)-1)/rate);
        diff = estimaed-futurvalue;
        if(diff>0){
            	change /= 2;
                rate -= change;
                estimaed = ((monthlyamount*(Math.pow((1 + rate),time)-1)/rate);
                diff = estimaed-dendamountd;
	}else if(diff<0){
                ratea += change;
                estimaed = (monthlyamount*(Math.pow((1 + rate),time)-1)/rate);
                diff = estimaed-dendamountd;
        }else{
               reutun rate
            }
     }while (Math.abs(diff) > 0.01);
  eutun rate
}

Comments

Popular posts from this blog

How to Create Corporate Bond with Covered Call Strategy?

A covered call position act like a corporate bond. Both give limited upside gains but also some downside protection. So I would like to explore if I can build a corporate bond position with stocks and the covered call strategy. Face Value Face value of an option is the first thing I am concerned. Although there is no real face value in the covered call positions, we still need to know how many stocks are covered by a short call contract. An option contract covers 100 shares of stock, so if I want to build a covered call position, I need to buy 100 shares of SPY for $373 with a total of $373*100 = $37,300. Already crazy. If I do a covered call once and the call option gets executed, I will have to sell stocks worth of about $37,300. How many times do I get to do this if I am not so rich? The mini-option of XSP, though a smaller contract size than SPX, still has this problem of one contract requires a lot of money for the underlying assets. XSP prices at 37...