Skip to content
Dmitry Astapov edited this page Oct 10, 2024 · 9 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 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-04-30 2% interest for £-693.82 over 30 days
    liabilities:mortgage                £-1.14
    expenses:mortgage interest           £1.14

2015-12-31 1.8% interest for £-696.07 over 245 days
    liabilities:mortgage                £-8.41
    expenses:mortgage interest           £8.41

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

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

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

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

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

Next steps

Handling foreign currency