Regular investment optimalisation

As discussed in the article on Rule 3: make regular investments there are benefits to being longer in the market, but also downsides to making regular transaction costs. This calculator will make a comparison between the options.

yearly investment ($)
fixed transaction cost ($)
variable transaction cost (%)
expected return (%)

Yearly Investment: The amount of money that you expect to invest each year. Example: 12000
Fixed transaction costs: the fixed amount you pay per transaction. Example: 8
Variable transaction costs: the variable amount you pay per transaction in percentages. Example: 0.15 for 0.15%
Expected return: The yearly return that you expect. The long term return of the stock market is about 8%. Example: 8