Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rent/buy comparison #11

Open
qwelias opened this issue Oct 29, 2022 · 0 comments
Open

Add rent/buy comparison #11

qwelias opened this issue Oct 29, 2022 · 0 comments

Comments

@qwelias
Copy link
Owner

qwelias commented Oct 29, 2022

price = 3090000
loan = 2625000
cost = 556000
saveRT = cost
saveBT = 0

intL = 0.03687
intT = 0

priceR = 0.01/12
infR = 0.01/12
saveR = 0.005/12

payL = 13406.10
inc = 30000
rent = 9500
rentT = 0
exp = 4000
expT = 0

mns = 0
maxm = 500

while (loan > 0 && mns < maxm) {
	intT += loan * intL / 12 * 0.75
	loan -= payL - loan * intL / 12
	expT += exp * (1+infR)**mns
	saveBT += saveBT * saveR
	saveBT += (inc - exp) * (1+infR)**mns - payL

	saveRT += saveRT * saveR
	saveRT += (inc - rent) * (1+infR) **mns
	rentT += rent * (1+infR) **mns

	mns++
}
price = price * (1+priceR)**mns
buys = price - intT - expT - cost - loan + saveBT
rents = saveRT - price

res = {loan, intT, expT, saveRT, mns, rentT, price, buys, rents}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant