Hi folks,
This morning I was chasing down a mismatch between what ledger was
producing and what my spreadsheets were producing for the balance of some
stocks.
It looks like the issue is that on 2025-02-07 midday I bought some shares
and so ledger logged the price of the shares using that txn entry.
Meanwhile, at market EOD, I also have a script that updates the pricedb
file with the closing prices.
Neither entry, ledger txn or pricedb entry, has a timestamp. I am inferring
that ledger was coded to decide to use the last txn entry to determine the
"current" price of the shares when one is available, otherwise use the last
pricedb entry?
One obvious way to work around this would be to add another pricedb entry
using today's date, but I was wondering if there was some better way to
tell ledger to prefer the pricedb entry?
2025-02-07 * (e4e4b4703903) Schwabb - Buy
Assets:Schwabb:VXUS 2.4191 VXUS @@ $150.00
Assets:Schwabb:Cash Sweep
$ date
Sat Feb 8 01:12:11 PM CST 2025
$ grep VXUS ~/.pricedb | tail
P 2025-01-27 VXUS $60.72
P 2025-01-28 VXUS $60.79
P 2025-01-29 VXUS $60.80
P 2025-01-30 VXUS $61.53
P 2025-01-31 VXUS $60.92
P 2025-02-03 VXUS $60.31
P 2025-02-04 VXUS $61.08
P 2025-02-05 VXUS $61.48
P 2025-02-06 VXUS $61.75
P 2025-02-07 VXUS $61.35
$ ledger pricedb VXUS | tail
P 2025/01/27 00:00:00 VXUS $60.72
P 2025/01/28 00:00:00 VXUS $60.668380462725
P 2025/01/29 00:00:00 VXUS $60.80
P 2025/01/30 00:00:00 VXUS $61.53
P 2025/01/31 00:00:00 VXUS $60.92
P 2025/02/03 00:00:00 VXUS $60.31
P 2025/02/04 00:00:00 VXUS $61.08
P 2025/02/05 00:00:00 VXUS $61.48
P 2025/02/06 00:00:00 VXUS $61.75
P 2025/02/07 00:00:00 VXUS $62.006531354636
Jim
--
---
You received this message because you are subscribed to the Google Groups
"Ledger" 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/ledger-cli/508f3a38-1649-4340-aebf-44ff9539ec49n%40googlegroups.com.