Contributions welcome.
Understanding the asset allocation of a portfolio is important. This script reports your current portfolio's asset allocation.
Configuration
You specify a set of accounts to consider (using regex patterns).
You also specify the percentage of each asset class for each commodity in your accounts as a part of its metadata in your Beancount ledger.
Sample output:
Asset Type Percentage Amount
-------------------- ------------ --------
bond 17.8% 240
bond_municipal 38.9% 525
equity 5.6% 75
equity_international 26.7% 360
realestate 11.1% 150
--- --- ---
Total 100.0% 1,350
Account balances:
`-- Assets
`-- Investments
|-- Brokerage 1 BNCT
`-- XTrade 2 BNCT
10 COFE
--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/c7491d83-2482-411d-9278-84d917086627%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
BTW, @blais has code for a more generic version of this in the beancount source (beancount/experiments/portfolio). Have you checked that out? It's lacking an example, but it's short and easy to understand if you can read python code.
Also check out this recent thread:
https://groups.google.com/forum/#!searchin/beancount/%22asset$20allocation%22|sort:date/beancount/F_pOdotQoxQ/4S4mBUMbAwAJ
The main point there being that exporting raw data to a spreadsheet which calculates your asset allocation is far more powerful than a static script, as it allows you to easily play with "what if" scenarios without having to change code.
To unsubscribe from this group and stop receiving emails from it, send an email to bean...@googlegroups.com.
The tool now outputs asset buckets in a hierarchy. It also supports tax-adjusted asset allocation. Example output:
Asset Type Percentage Amount
--------------- ------------ --------
total 100.0% 2,750
bond 48.2% 1,325
municipal 19.1% 525
equity 46.4% 1,275
international 43.6% 1,200
realestate 5.5% 150
Account balances:
`-- Assets
`-- Investments 7 BNCT
|-- Brokerage 1 BNCT
`-- XTrade 2 BNCT
10 COFE