cost_spec and price_annotation can be different?

28 views
Skip to first unread message

yegle

unread,
May 26, 2016, 1:01:23 AM5/26/16
to Beancount
It seems like beancount allow cost_spec and price_annotation to be different, e.g.

2016-01-01 *
    Assets:One 1 SOMETHING {100 USD, 2016-01-01} @200 USD
    Assets:Two -100 USD

Also it's weird that the balance is checked using the price in cost_spec, not the one in price_annotation.

--

Martin Blais

unread,
May 26, 2016, 1:16:11 AM5/26/16
to Beancount

That's on purpose.
Think about it it makes a lot of sense...
Check out the trading document for an example of a sale with a capital gain and you'll see why.

Price only matters for currency conversions. For sales the cash proceeds contain the same information.

Offline now otherwise I'd type it right here.

--
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/CAFL5w3WAA5FKcKe1KmOBO6pOTkX%3DgFZNAf9SsT%3DajDp6tG%3D6Ew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

yegle

unread,
May 26, 2016, 12:21:15 PM5/26/16
to Beancount
Yes it makes sense to have different price in cost_spec/price_annotation when selling, where in buying/acquiring it should match right?

Is it reasonable to add a check here that for buying/acquiring the two prices should match? Or even make the price_annotation invalid syntax for buying/acquiring?


For more options, visit https://groups.google.com/d/optout.

Martin Blais

unread,
May 27, 2016, 1:48:11 AM5/27/16
to Beancount
(Apologies for the delay, I don't respond to OSS projects during work hours. More below.)

On Thu, May 26, 2016 at 12:20 PM, yegle <cny...@gmail.com> wrote:
Yes it makes sense to have different price in cost_spec/price_annotation when selling, where in buying/acquiring it should match right?

In most cases, yes, but not necessarily. The cost basis you carry the lot can be different from the price of the underlying asset. For example, commission & fees incurred in buying may be included in the cost basis, or if for whatever reason you got a discount on whatever you bought..

(I'll admit I don't yet have a good story on automating that calculation yet, so all my purchases have no price on them either.)


Is it reasonable to add a check here that for buying/acquiring the two prices should match?

Not in the general case, but if you'd like to constrain or protect your input further, you can easily do this validation in a plugin.


Or even make the price_annotation invalid syntax for buying/acquiring?

Not at the syntax level, because it may be useful in the future, and inserting an implicit price directive which differs from the cost of purchase still makes sense.




 

Reply all
Reply to author
Forward
0 new messages