Price annotation for balance directive

35 views
Skip to first unread message

yegle

unread,
Jun 8, 2016, 1:36:33 AM6/8/16
to Beancount
Martin,

Current code doesn't support price annotation in balance directives. Would it possible to add support for optional price annotation?

E.g. for account holding some stocks:

2016-06-01 balance Assets:Investment:Broker 1024 XYZ {100.00 USD}

The implicit_prices plugin can then use this directive to extract price information.

--

Martin Blais

unread,
Jun 8, 2016, 10:20:51 AM6/8/16
to Beancount
You mean, would it be possible to add support for "cost basis" balance checks.

The question has to be reframed:
- Do we want to assert the _total_ amount of cost basis in an account for a particular currency, and how useful is it?
- Do we want to assert the existence of a particular lot? What if there are multiple lots? (Usually there are.)
- How do we assert the absence of a lot? Or is the syntax meant to assert the total contents of an account?

This needs more fleshing out.
What's your use case?
What problem are you trying to solve?


yegle

unread,
Jun 8, 2016, 11:27:59 AM6/8/16
to Beancount
Hi Martin,

I think I gave a wrong example. (I mixed cost basis with price). What I want is to specify the number of stock units and the FMV on that day in one directive. Usually the FMV and number of units will show on the statement, what I'm doing right now is one balance directive and one price directive for each commodity in an account.


To answer your question:

- Do we want to assert the _total_ amount of cost basis in an account for a particular currency, and how useful is it?
My bad, this is not a good example. Something like this will also do. This shows I have 1024 unit of XYZ on 06/01/2016, and the FMV of XYZ on that day is 100.00 USD

2016-06-01 balance Assets:Investment:Broker 1024 XYZ @100.00 USD

- Do we want to assert the existence of a particular lot? What if there are multiple lots? (Usually there are.)
FMV should apply to all lots. I *don't* want to assert balance on a particular lot.

- How do we assert the absence of a lot? Or is the syntax meant to assert the total contents of an account?
This syntax is more of a shorthand for something like this:

2016-06-01 balance Assets:Investment:broker 1024 XYZ
2016-06-01 price XYZ 100.00 USD


--
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/CAK21%2BhND3t5LZBFsWUZa5KYW_1Q9OaX8Spgft71XD%2BN6sscgEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Martin Blais

unread,
Jun 8, 2016, 11:24:38 PM6/8/16
to Beancount
On Wed, Jun 8, 2016 at 11:27 AM, yegle <cny...@gmail.com> wrote:
Hi Martin,

I think I gave a wrong example. (I mixed cost basis with price). What I want is to specify the number of stock units and the FMV on that day in one directive. Usually the FMV and number of units will show on the statement, what I'm doing right now is one balance directive and one price directive for each commodity in an account.


To answer your question:
- Do we want to assert the _total_ amount of cost basis in an account for a particular currency, and how useful is it?
My bad, this is not a good example. Something like this will also do. This shows I have 1024 unit of XYZ on 06/01/2016, and the FMV of XYZ on that day is 100.00 USD

2016-06-01 balance Assets:Investment:Broker 1024 XYZ @100.00 USD

- Do we want to assert the existence of a particular lot? What if there are multiple lots? (Usually there are.)
FMV should apply to all lots. I *don't* want to assert balance on a particular lot.

- How do we assert the absence of a lot? Or is the syntax meant to assert the total contents of an account?
This syntax is more of a shorthand for something like this:

2016-06-01 balance Assets:Investment:broker 1024 XYZ
2016-06-01 price XYZ 100.00 USD

I see.
So as for a posting, the price wouldn't be used for much else than to fill in the database.
Can anyone think of another usage for that price in association with the balance?




Reply all
Reply to author
Forward
0 new messages