hledger

Since about June 2016 I have been using hledger to track my fin­ances. How I do so has evolved, this memo doc­u­ments the cur­rent pro­cess.

Pros:

  • Makes me more con­scious of my spend­ing.
  • Lets me see how my spending has changed over time.
  • Lets me fore­cast reas­on­ably eas­ily.
  • Way less cum­ber­some than the massive 7-year spread­sheet I used to use.

Cons:

  • Not so great for get­ting in­sights like “wow, I spent a lot on takeaways last month”: I can get that data fairly eas­ily, but there isn’t really an un­con­scious aware­ness of it like there is with (eg) food spending in gen­eral.

Journal Files

My journal files are shared with sync­thing, so I can add trans­ac­tions from any ma­chine.

I have a few files:

  • “cur­rent.­journal” is the journal for the cur­rent year, struc­tured as an org dat­etree (even though it’s not an org file).
  • “$YEAR.­journal” is the journal for the named year.
  • “fu­ture.­journal” is the journal for the next year, which only in­cludes big things I am cer­tain of, like rent pay­ments for a signed con­tract.

Ac­counts

I have a number of ac­counts, some few of which are ac­tual ac­counts (in bold), but most of which are “vir­tual” ac­counts (in it­alic), which I use to get better in­sights into the flow of my money.

  • as­sets: money I have
    • cash: eas­ily-ac­cess­ible money
      • hand: money in my wallet
      • paypal: money in my paypal ac­count
      • sant­ander: money in my Sant­ander ac­counts
        • esaver: money in my esaver ac­count (one sub­ac­count per ear­maked pur­pose)
          • (eg) rainyday: saved for a non-spe­cific fu­ture “rainy day”
        • cur­rent: money in my cur­rent ac­count (in­cluding over­draft)
          • ac­cum: see the Budgeting sec­tion.
          • month: see the Budgeting sec­tion.
          • saved: money put aside for a spe­cific trans­ac­tion, such as rent.
          • un­al­loc­ated: money in my cur­rent ac­count not al­loc­ated for any­thing in par­tic­u­lar.
    • in­vest­ments: money in the hands of an in­vest­ment broker
      • cav­endish: money with Cav­endish On­line
        • s&s: my stock­s&shares ISA.
    • re­im­burse­ments: money people owe me (one sub­ac­count per per­son)
      • (eg) nathan: money Nathan owes me
  • equity: used in the start and end of year pro­ced­ures
  • ex­penses: used to track ex­penses of dif­ferent sorts (one sub­ac­count per use)
    • (eg) books: money spent on books
  • in­come: used to track in­come of dif­ferent sorts (one sub­ac­count per use)
    • (eg) in­terest: bank in­terest
  • li­ab­il­it­ies: money I owe people
    • over­draft: my bank over­draft, treated as a li­ab­ility so I re­member it’s not free money.
    • slc: my stu­dent loans

Trans­ac­tions

Trans­ac­tions are of the form:

$MONTH/$DAY $PAYEE
    $POST­ING­S...

Trans­ac­tions purely between vir­tual ac­counts get a ! between the date and the de­scrip­tion. Trans­ac­tions re­con­ciled at the end of the month get a *.

Budgeting

The “ac­cum” and “month” vir­tual ac­counts are the most im­port­ant, as they give me a con­stant aware­ness of how much I have spent on a par­tic­ular class of thing. I don’t often ex­ceed my budget, be­cause when I go to spend some budgeted money there’s now a little voice in the back of my mind which asks “can you ac­tu­ally af­ford this?”.

There are five “month” ac­counts which get set to a fixed value at the start of each month:

  • food: everything ed­ible; gro­cer­ies, takeaways, snacks, res­taur­ants, etc
  • google apps: arch­hurd.org’s google apps ac­count
  • house­hold: a gen­eral hodge­podge of things which I need but don’t really fall into a sens­ible col­lec­tion; toi­letries, laun­dry, kit­chen equip­ment, etc
  • servers: fairly self ex­plan­at­ory.

And there are two “ac­cum” ac­counts which get a fixed amount trans­ferred to them at the start of each month (ac­cu­mu­lating un­spent money):

  • fun: en­ter­tain­ment; games, swing dance, etc
  • other: any­thing not covered by an­other cat­egory

Fore­casting

I use a re­l­at­ively simple fore­casting pro­cess. For every month up until the end of the year (or maybe until the middle of the next year, if we’re near the end of this one), I add trans­ac­tions:

  • For every in­come (eg, in­tern­ship pay­ment) I am cer­tain of
  • For every ex­pense (eg, rent) I am reas­on­ably con­fident of
  • Spending the en­tire budget
  • Hand­ling any ex­pected move­ment between ac­counts (eg, cur­rent ac­count to ISA)

This gives me a reas­on­ably ac­cur­ate, per­haps slightly pess­im­istic, fore­cast of my fin­ances. The con­fid­ence threshold for in­cluding ex­penses is lower than for in­cluding in­come, which is pess­im­istic; but I as­sume I will never over­spend my budget, which is typ­ical but not cer­tain.

An Ex­ample Month

Here is the sort of thing that will go in a monthly entry. Of course some things, like rent and tu­ition, will be more or less fre­quent than oth­ers:

10/01 Budget & Saving
    ac­cum:fun           £25
    ac­cum:other         £75
    month:­food        £200
    month:­google apps   £2.75
    month:­house­hold    £25
    month:servers      £39.50
    saved:in­vest      £400
    un­al­loc­ated

10/01 Linode
    ex­penses:servers  $20 @@ £18
    ex­penses:servers          £1.25
    month:servers

10/01 OVH
    ex­penses:servers  EUR 20.39 @@ £18.05
    ex­penses:servers                £1.25
    month:servers

10/02 Arch Hurd Google Apps
    ex­penses:­google apps  £2.75
    month:­google apps

10/06 Dad money
    un­al­loc­ated  £650
    in­come:dad

10/07 Hol­gate rent
    ex­penses:rent  £1045
    saved:rent

10/24 Dentist
    ex­penses:other  £18.80
    un­al­loc­ated

10/31 Tu­ition
    ex­penses:tu­ition  £1398
    saved:tu­ition

Most months are the same, so adding these sets of trans­ac­tions for every month re­maining in the year takes very little time.

Start/End of X Pro­cedure

Year

  1. Zero all ac­counts by trans­fer­ring everything into equity.
  2. Re­name the cur­rent journal file from “cur­rent.­journal” to “$YEAR.­journal”
  3. Take the “fu­ture.­journal” and re­name to “cur­rent.­journ­al”.
  4. Add fore­casting trans­ac­tions for the new year
  5. Ini­tialise all ac­counts on the first of January by trans­fer­ring from equity.

If starting a new journal file, this is the tem­plate:

alias cur­rent = as­set­s:cash:sant­and­er­:­cur­rent
alias budget  = cur­rent:­month
alias saved   = cur­rent:saved
alias accum   = cur­rent:accum
alias un­al­loc­ated = cur­rent:un­al­loc­ated

* $YEAR
Y$YEAR
** $YEAR-01 January
** $YEAR-02 Feb­ruary
** $YEAR-03 March
** $YEAR-04 April
** $YEAR-05 May
** $YEAR-06 June
** $YEAR-07 July
** $YEAR-08 Au­gust
** $YEAR-09 September
** $YEAR-10 Oc­tober
** $YEAR-11 November
** $YEAR-12 December

Here are ex­ample equity trans­ac­tions:

01/01 ! Start-of-year (as­sets)
    as­set­s:cash:hand                £77.81
    as­set­s:reim­burse­ment­s:nathan     £9.98
    saved:rainyday                  £74.90
    saved:rent                    £1800
    saved:tu­ition                 £2060
    un­al­loc­ated                    £904.92
    equity:­car­ried for­ward

01/01 ! Start-of-year (li­ab­il­it­ies)
    li­ab­il­it­ies:over­draft   -£2000
    li­ab­il­it­ies:slc        -£28510.01
    li­ab­il­it­ies:teasoc         -£1
    equity:li­ab­il­ities

Month

  1. Re­con­cile the trans­ac­tions of the month just ended:
    • For every trans­ac­tion in the on­line bank state­ment, find the cor­res­ponding journal trans­ac­tion and mark it.
      • If there are trans­ac­tions missing from the journal, add and mark them.
      • If there are trans­ac­tions missing from the bank state­ment, the bank is being slow; add posting dates and re­con­cile as they come in.
      • If the bank bal­ance is below the as­set­s:cash:sant­and­er­:­cur­rent bal­ance, even dis­carding un­cleared trans­ac­tions, (a) figure out what happened and (b) if im­possible, add a trans­ac­tion to ex­penses:­ad­just­ment
    • Count the bal­ance in my wallet and mark all as­set­s:cash:hand trans­ac­tions.
      • If the wallet bal­ance is below the as­set­s:cash:hand bal­ance, add a trans­ac­tion to ex­penses:­ad­just­ment
  2. Zero the monthly budget by adding trans­ac­tions to the month just star­ted:
    • Transfer “month” ac­counts into un­al­loc­ated
    • If there was an over­spend, zero by trans­fer­ring from un­al­loc­ated
  3. De­lete the pess­im­istic budget-spending trans­ac­tion of the month just star­ted.
  4. Com­ment all trans­ac­tions in the month just started other than the budget set-up.
    • Un­com­ment these as they hap­pen. From now, the bal­ance re­ported for the cur­rent month is the cur­rent ac­tual bal­ance.

Here are ex­ample en­d-of-­month trans­ac­tions:

03/31 * Wallet ad­just­ment
    ex­penses:­ad­just­ment  £14.98
    as­set­s:cash:hand

04/01 ! Re­maining budget
    month:­food        £24.70
    month:fun        £112
    month:­house­hold   -£9.12
    month:servers     -£2.01
    month:anything

04/01 ! Budget over­spend
    month:anything  £125.57
    un­al­loc­ated

Ideally, there should be no trans­ac­tion ad­justing the bal­ance.

Date
Tags
finance, hledger, howto
Deprecated By
personal-finance
Target Audience
Mostly me, & possibly personal finance nerds.
Epistemic Status
Documents how I used to do things, doesn't attempt to speak more generally than that.
Attention Conservation Notice
You may get something out of this if you're rethinking how you manage your finances.