You may be disappointed to find out that GnuCash is not a personal finance manager, nor an investment portfolio manager, but a double-entry accounting application. The main drawback of the current reports in GnuCash is that they treat every position as separate, so the same security held at two different brokers is treated as two completely separate entities.
Nonetheless, GnuCash can be a decent base for a portfolio manager as it contains all the transactions.
There seems to be plenty of additional projects out there made by people who miss certain functionality and write their own code to get to the goal they are after.
This is what I did, also. I went ahead from the idea similar to yours and later branched off into a few separate packages:
- Price Database, similar to F::Q, downloads the prices. I found it difficult and slow to add scripts to the original F::Q and added a few providers that I use here. In addition, this keeps a separate database of security and currency prices to avoid adding extra weight to a GnuCash database.
- GnuCash Portfolio, the original project. Contains the logic for the few reports useful for me (and perhaps others). The idea was to recreate a few portfolio reports I found useful in the previous financial package and assist with tax sheet preparation. There are two additional projects for the UI, namely Web and CLI. Things like Portfolio Value and Security Analysis go here.
- Asset Allocation, a package that encapsulates asset allocation functionality as described in various books. After a model is created, with given % allocations, it generates a report to compare the assigned allocations to the current ones. Used in combination with the PriceDb to get the current value of the portfolio.
If anyone finds these useful, and have some knowledge of Python, they'd be welcome to join in and contribute to the features they would like to use.