Another approach to foreign currency accounts

I've made a little tool that uses the YNAB API to automate the approach I've been using for managing foreign currency accounts in a single budget.

I'm posting here in the API forum first in the hopes to get some feedback before publicizing more widely.

Some notable features of this approach that may set it apart from other solutions:

  • All your accounts, both local and foreign currency, are in a single budget so you can see the state of all your finances at a glance.
  • Auto-import, manual import, and reconciliation for foreign currency accounts works normally, in the original foreign currency.
  • Reports and net worth will always be shown in your local currency, with all foreign amounts converted at an exchange rate accurate to within 24 hours.
  • Budget categories are in your local currency, and it's no problem to mix local and foreign currency transactions in the same budget category.
  • Handles split transactions.
  • Foreign currency balances are automatically adjusted as the currency fluctuates, at an exchange rate accurate to within 24 hours.
  • Your original transactions left are untouched.
  • Uses historical exchange rates for transactions in the past.

The approach boils down to:

  • keeping the foreign accounts and transactions in their original currencies, so that auto-imports and reconciliation work as normal
  • maintaining a "virtual" account for each foreign currency that has transactions for the difference between the foreign currency and the local currency, so that your net worth and budget categories are correct in the local currency.
  • creating periodic adjustment transactions in the "virtual" difference accounts for fluctuating exchange rates.

I've been doing this manually for several years, after trying some other approaches, and found it works really well for our family budget which crosses three different currencies and involves a lot of foreign transactions and transfers.

Right now this is a **preview** that's just a command-line tool.  If there's sufficient interest, I plan to turn it into a user friendly web app.

If this sounds interesting to you, please download the tool, give it a try, and let me know what you think:

https://borsboom.io/foreign-currency-accounts-for-ynab/

37replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • FYI: I've found and fixed a few bugs, so if you're trying this out you should probably grab a new version by following the links from https://borsboom.io/foreign-currency-accounts-for-ynab/#tool-setup

    Like
    • Hi Emanuel Borsboom !

      Thank you for taking the time to build this tool! If you'd like to have this integration listed on our Works with YNAB page, please send an email to [email protected] - this will allow us to recommend it as an option to YNABers who ask. :)

      Like 1
    • Faness I'd like to hold off until I've finished a web app for this so it's easier for people to use than a CLI.

      Like 1
  • This could be so handy for a trip I take in two months where I’ll be using 5 different currencies. I have been concerned about how to deal with it all in my current budget so I can’t wait to try this out. 

    Like
    • QC Great, I'm looking forward to hearing how it works out for you!

      Like
  • I'm wondering how well you think this might work for my case. I have three budgets right now. I have a custom tool that outputs a range of transactions as a Xero-friendly CSV. I use this for foreign accounts that I can't link to it, and that I can't easily connect via API because hardly anyone's actually implemented PSD2 APIs yet :(

    Something I wish existed (but which I don't have _quite_ enough pain to actually build) is a tool to basically aggregate all of my budgets in a reference currency in a fourth budget. Then I could just use YNAB Reports to see spending and net worth change. Really, even just a third-party report tool that could base itself off multiple budgets (I guess with a little category mapping in order to treat various categories as the same thing) would be pretty neat. As it is, I just made a small spreadsheet where I convert all the net worth values to one currency and track the change that way. Not perfect, but gives me some indication of the direction of things.

    Like
    • Kevin K. While I'm not 100% certain I understand your use case, I think this tool might work for you.  Instead of having four budgets, you just have one budget with its currency set to the "reference currency."   Add all your accounts to it, and tag any that are not in the reference currency with <CODE> (e.g. <USD>).  Add "difference accounts" for each of the non-reference currencies, and this tool will make sure these difference accounts always contain for the difference in value from the reference currency, so your net worth and reports will be shown in the reference currency (with other currencies having been converted using an exchange rate accurate to within 24 hours).

      Give it a try, and let me know how it goes!

      Like
      • Kevin K.
      • kkaland
      • 6 mths ago
      • Reported - view

      Emanuel Borsboom Thanks for the fast reply! Hmm, yeah, if I still enter all the amounts in terms of what I spent (rather than some tool deciding on the rate), that means I can export those accounts and still rely on the numbers for my accounting. I have to re-read the docs and check if it supports splits, even if it handles them as two transactions. But I'm kind of seeing now how this could work in my head, and I think I need to try it. Maybe I will make a fourth budget and see if I can import some history to test it.

      Like
      • Kevin K.
      • kkaland
      • 6 mths ago
      • Reported - view

      Emanuel Borsboom 

      1. Went ahead and set this up on a test budget to see how it worked. Looks nice. I found one small thing I had a question about, which is the split transaction payee. I tend to split by setting the Payee on the parent transaction and leaving them blank on the sub-transactions. I can easily change this behavior, just thought to mention it. Is there a special reason for not defaulting to the parent?

      2. I originally wanted to use this with my USD budget (since that's my base currency for business and so on), but I guess I should actually use it with my EUR budget since that's where I budget most things. I budget some things in USD, but I guess I can just estimate those. If I want to see a USD balance, I can just convert with an average rate or whatever. I don't really use YNAB for reporting anyway. I basically only use the net worth report for estimating my personal expenses in another spreadsheet, and this would be close enough.

      If my "home currency" changes, I could just edit my settings and set this up on that base-currency budget, yeah? I'm assuming the tool segments the data by budget ID or something, such that this wouldn't cause issues (and the leftover accounts/difference accounts in the old budget wouldn't be an issue, I'd just have to combine info from two spending reports until the following year).

      3. I'll have to think about whether I want to just estimate in USD (not my home currency, but I interact with it a lot), and maybe be a little wrong about some budget items some months, but basically never have to change it.

      Do you find that you have a pretty good handle on how much to keep in each physical account with this approach? I've been collecting bank accounts (maybe you can relate), and I have a spreadsheet I use each month where I add up sets of budget categories and then figure out what my balance should be. If all of the budget categories are in a particular currency, I guess it'll kind of obscure what the ideal balance for an account should be. I guess nothing stops me from splitting up budget categories by what account they come from, though (US Books, EU Books, etc.). Feels silly, but budgeting would probably still be a lot simpler...and I'd be able to delete like half of my spreadsheet :D

      Like
    • I tend to split by setting the Payee on the parent transaction and leaving them blank on the sub-transactions. I can easily change this behavior, just thought to mention it. Is there a special reason for not defaulting to the parent?

      There's no special reason, it just uses whatever the payee is on the split so if the payee is blank it uses a blank payee.  I usually set payees on splits, so I never noticed.   I can't think of a reason not to default blank split payees to the parent's payee, so that's a change I'd be happy to make.  Would you mind opening an issue on the issue tracker for this?

      Like 1
    • If my "home currency" changes, I could just edit my settings and set this up on that base-currency budget, yeah? I'm assuming the tool segments the data by budget ID or something, such that this wouldn't cause issues

      Yes, the tool does separate data by budget ID, so it's safe to use with multiple budgets and each is treated completely independently.

      Like
    • Do you find that you have a pretty good handle on how much to keep in each physical account with this approach?

      It seems to work for me.  I do tend to keep a pretty good buffer in the accounts of each currency I use most frequently, and keep an eye on my account balances and make sure I have enough to cover typical spending.  And if I'm buying something bigger than usual, I'll check the account balance first and move some money if need be. 

      Like 1
  • Just brilliant!   It is so much easier now to reconcile my foreign accounts, which were quite a pain before.

    Thank you!!

    Like
    • Purple Mill Awesome, thanks for letting me know.  Very glad to hear my solution is working for someone else too!

      Like
      • Kevin K.
      • kkaland
      • 6 mths ago
      • Reported - view

      James Rose Totally agree. I'm actually keeping better tabs on my budget now that I don't have to keep switching between them.

      Like
  • Emanuel,  what does one call a tracking account difference account?  The instructions say to name it the same as a Cash difference account, but you can't name them both <EUR DIFFERENCE> .  

    Like
    • James Rose All that matters is that "<EUR DIFFERENCE>" appears somewhere in the account's nickname or notes, but you can add other text as well, so you could call it "<EUR DIFFERENCE> Tracking", for example.  I'll have to clarify that in the documentation.

      Like 1
  • This is brilliant.  Thank you so much.  I'd love to see it as a web app.  I only set it up today but I can already see this will make my life so much easier.  I live in NZ but I still have accounts in the US and have long been managing everything in a pair of YNAB4 budgets.  Having everything in one budget while still tracking my US accounts in USD...amaaaazing!

    Like 1
    • Eniariom I'm thinking I might add a few testimonials to the home page.  Would you mind if I use your words?

      Like
      • Eniariom
      • eniariom
      • 1 mth ago
      • Reported - view

      Emanuel Borsboom  Sure, no problem. :)

      Like
  • This looks fantastic and I can't wait to use it, however I'm having some major trouble with the .exe file. It's not at all opening on my computer and I'm not sure if its something from my computer or from the file itself. I have a Windows Home 64-bit pc, which should be fine I think. I appreciate any help you might be able to give and thanks for making this awesome tool!

    Like
    • Cornflower Blue Door What happens when you try to run it?

      Like
    • Emanuel Borsboom  a tab opens very briefly on my screen and then immediately closes. I've tried a few online fixes for .exe files not opening but with no luck. I've attached a screen capture of what I'm seeing.

      Like
    • Cornflower Blue Door It looks like you're trying to run it by double clicking on it.  Unfortunately this tool doesn't have a graphical user interface, only a command-line interface (CLI) intended to be run using Windows' Command Prompt application.  As is normal for CLI applications on Windows, if run without any command-line arguments (which is what double-clicking it does), a terminal window briefly pops up with the CLI usage information and then closes immediately.

      I'm (slowly) working on a Web interface for the tool, so eventually it'll be possible to use from your web browser.

      Like
    • Emanuel Borsboom Apologies for lack of programming knowledge, thanks so much! Ran it in command prompt without problems

      Like
  • Your approach is amazing and multicurrency became sane. Meaning that instead of cancelling my YNAB subscription I will continue using it after a year of pain.

    I do know that it is an opinionated approach. I mean, there are many ways to deal with that issue, yours is one I like.

    I don't know why YNAB doesn't do something or similar or something at all. 

    Like
    • Javier Gonel Thanks for your kind words!  Every time I get a comment like this it is a big motivation to continue working on the web version (getting there... functionality is all in place and now it's a matter of refinement.  i.e. the first 90% is done, and now I just have the other 90% left).

      Like 1
    • Javier Gonel I'm thinking I might add a few testimonials to the home page.  Would you mind if I use your words?

      Like
  • Hi everyone,

    The long-promised web based version of this tool is finally nearing the point where I feel comfortable opening it up to general use, but I'd like a few beta testers first.  The underlying processor is exactly the same as the command-line version, so that part is well tested by many people at this point and there are no currently known bugs.  But now there's a (sort-of) friendlier web UI and you don't need to mess with the command-line anymore.

    If you've been wanting to try this tool but were intimidated by using a command-line app, now would be a great time to try out the web based version.

    And if you've been using the command-line version but would rather not have to remember to run it yourself or manage a cron job, I can import your data into the web-based version and it can take over where the CLI leaves off.

    If you'd like to be a beta tester, shoot me an email at [email protected].

    Note: the app is currently still in Restricted Mode, which means YNAB is limiting it to 25 users.  I've requested to have that lifted, but I'm not sure how long YNAB usually takes to process those requests.

    Looking forward to your feedback!

    Like 1
  • Wow, this works so well.  I tested different workflows, like changing the category of a foreign transaction after the diff transaction was added, as well as removing a foreign transaction, and in all cases your tool takes care of it perfectly.

    Thank you so much for making this seamless tool.  As someone who lives in two currencies, it has made YNAB so much more useful and easy to use.

    Like
    • James Rose Thanks for the kind words!  Some of the most "fun" to get right were edge cases like two transactions getting matched (or unmatched), and single transactions turning into splits (and vice-versa).

      Like 1
    • James Rose I'm thinking I might add a few testimonials to the fca4ynab home page.  Would you mind if I use your words?

      Like
      • James
      • Purple_Mill
      • 1 mth ago
      • Reported - view

      Emanuel Borsboom feel free to use my words. 

      Like
  • The web-based version of the app has now been approved by YNAB. You can check it out at https://fca4ynab.borsboom.io/!

    Like 2
    • Emanuel Borsboom 🎉

      Now that your app has been approved, I'm looking forward to being able to recommend it to users who ask! :)

      Like
  • Hi Emanuel,

    What a great job you're doing! Thanks for that!

    I am currently testing you web-based version. I have a question for this:

     - in my budgets, I have some operations that are older than one year. So I get the following error message:

    "Failed to get exchange rate(s) from Currency Converter API. Free version only allows up to 1 year earlier."

    How do you manage old operations ? And why did you chose to use the daily rate for the operations instead of the today's one everywhere? I currently can't change anymore the date to start the foreign currency transactions.

    Thanks!

    Edit: I just found out that the rate can be extracted easily from the European Central Bank easily: https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/eurofxref-graph-chf.en.html. I will probably modify your tool to take those values for old operations.

    Like
    • Navy Blue Lion I've made a change that should now let it get exchange rates for transactions older than a year, so hopefully this will help.

      • why did you chose to use the daily rate for the operations instead of the today's one everywhere

      I want the converted amount I spent on a given date to reflect how much that actually cost on the day it happened.  Exchange rates fluctuate so by anchoring a transaction's rate to the date it actually happened is more accurate, since otherwise the rate picked will happen to be the rate on the date when it was processed rather than anything tied to the transaction itself.  But maybe for your use case this is less desirable; if so I'm interested in understanding it, and could potentially make this behaviour optional if there's sufficient demand.

      • How do you manage old operations

      For the most part, I'd recommend not trying to process old transactions since that may mess up past budget category amounts. 

      • I currently can't change anymore the date to start the foreign currency transactions.

      If you'd like to adjust the start date, shoot me an e-mail at [email protected] with your budget URL and I can make that change for you. There are some implications to changing it that may be unexpected which is why I didn't make it possible from the UI yet. Be aware that, after doing this, any previously processed transactions from before the start date will not be re-processed if they're modified. Also, changing the start date to an earlier date won't retroactively process pre-existing transactions.

      Like
Like6 Follow
  • 6 Likes
  • 4 wk agoLast active
  • 37Replies
  • 956Views
  • 11 Following