Apologies for going a bit tangential - but I thought this would be an 
interesting point to discuss somewhere
 

The main reason I record the unit price in commodities held at cost is to 
match how my brokers store/expose it. Makes it easy to cross-check with 
statements when needed or for lot matching when selling. A secondary but 
equally important reason is to catch errors during import. It’s all too 
easy to miss a new type of fee or such that the importer hasn’t seen, if 
the total price is “absorbed in”.

I would consider implementing this differently. The price exposed on the 
statement is *not* the price - or, perhaps not always, depending on the 
broker.  It is an *approximation* of the price, sometimes not even 
significant to the the point that it prints.  Vanguard, for instance, on 
some of my accounts (I think my 529), reports prices at 4 decimal points, 
but rounds it to 3 with a trailing 0, while I can get the 'more correct' 
price online.  I've also seen different rounding prices in CSV vs OFX 
exports from the same statements, and I've seen different conventions where 
trailing 0's are dropped only when correct vs rounding - leading to strict 
Decimal tolerance issues.  But even if all those were solved for, it's not 
actually the "price.''  When they calculate gains etc, they use whatever 
they use in the backend - probably to more significant digits than what is 
exposed.

I would suggest a more accurate method to capture that 'approximate' price 
and do one of two things - either raise an error on import if the 'real' 
price deviates from the reported price by a significant amount, or store it 
as metadata you can build checks on later.

I only do automatic lot specification so I'm not sure on the best approach 
to suggest, but I would presume your concerns are also easier to address by 
specifying date or label of a lot rather than a price, and let the more 
accurate price calculations run through.

The only downside I have encountered with 'accurate pricing' is that Fava 
displays all the significant digits, and that's annoying - but that would 
be better solved by a view setting in Fava...

​

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/beancount/614ccff7-e41a-4ce6-9442-878bb34a1e89n%40googlegroups.com.

Reply via email to