Skip to content
Dmitry Astapov edited this page Jun 8, 2020 · 8 revisions

Associated directory: 09-remortgage

How to handle changes in mortgage conditions

If at a certain point you decide to re-mortgage, chances are that your new mortgage conditions would be different.

Typically, your interest rate would change, which means that the script that computes interest payments should change as well.

If you are using hledger-interest version 1.5.3 or below you will need to pre-filter output of hledger-interest with hledger print so that only transactions up to the month when you re-mortgaged are emitted, and then use this output to compute final balance at the time of remortgage, and then send your journal to hledger-interest again, this time prefiltered so that only post-remortgage transactions are included, and also throw remortgage day balance in the mix. Nothing that cannot be achieved with 20-100 lines of bash or python :) And next time you would probably avoid remortgaging just so that you will not have to fix this script again.

With hledger-interest 1.5.4 or above, there is an easier way: you can specify rate schedule. If your old rate r1 was effective from 2017-01-01, and your new rate r2 is effective from 2019-04-05, then hledger-interest could be invoked with your rate schedule like this:

hledger-interest --annual-schedule='[(2017-01-01, r1), (2019-04-05, r2)]' <rest of the arguments>

Initial date does not have to be precise, it just has to be on or before first mortgage payment. It is perfectly ok to set it way in the past.

Let's say that in our example a new rate of 1.8% comes into effect in 2016. We can check that hledger-interest properly applies it to the next payment:

$ hledger-interest -f all.journal --source='expenses:mortgage interest' --target=liabilities:mortgage --annual=0.02 --act liabilities:mortgage --annual-schedule='[(2000-01-01,0.02),(2015-05-01,0.018)]' -q | hledger -f - print 'amt:>0'

2014-03-31 2% interest for £-855.00 over 88 days
    liabilities:mortgage                £-4.12
    expenses:mortgage interest           £4.12

2014-12-31 2% interest for £-763.24 over 275 days
    liabilities:mortgage               £-11.50
    expenses:mortgage interest          £11.50

2015-03-31 2% interest for £-786.18 over 89 days
    liabilities:mortgage                £-3.83
    expenses:mortgage interest           £3.83

2015-12-31 2% interest for £-693.82 over 275 days
    liabilities:mortgage               £-10.45
    expenses:mortgage interest          £10.45

2016-03-31 1.8% interest for £-714.43 over 90 days
    liabilities:mortgage                £-3.16
    expenses:mortgage interest           £3.16

2016-12-31 1.8% interest for £-620.66 over 275 days
    liabilities:mortgage                £-8.39
    expenses:mortgage interest           £8.39

2017-03-31 1.8% interest for £-637.00 over 89 days
    liabilities:mortgage                £-2.80
    expenses:mortgage interest           £2.80

2017-12-31 1.8% interest for £-542.44 over 275 days
    liabilities:mortgage                £-7.36
    expenses:mortgage interest           £7.36

Modified mortgage-interest script that demonstrates this could be found in 09-remortgage or diffs/08-to-09.diff.

Next steps

Handling foreign currency