Here’s a plugin <https://github.com/hoostus/beancount-asset-transfer-plugin>
that does what you want. But more interestingly, the README on that page
explains and shows you how to do it.
When transferring assets in-kind (for example between two brokerages) you
want to preserve the cost basis and acquisition date of each lot. You can
do this manually in beancount like so:
2021-09-10 * "Transfer APPL from Schwab to Fidelity" Assets:Schwab -100
AAPL {10.00 USD, 2018-05-18} Assets:Fidelity 100 APPL {10.00 USD,
2018-05-18}
bean-doctor will show you the list of lots. From there, simply use your
editor to get the transaction you want.
If you’re wanting to simulate average cost booking when doing the transfer,
something like this should work (untested), where 156.67 is the average
cost basis you manually calculate:
2024-06-01 * "Transfer and consolidate AAPL" Assets:Brokerage:Old -30 AAPL
@ 156.67 USD Assets:Brokerage:New 30 AAPL {156.67 USD}
On Friday, June 20, 2025 at 4:06:38 PM UTC-7 Alex Kaufman wrote:
Thank you for the help here. It sounds like the most straightforward option
for transferring accounts with average cost booking without realizing
nonexistent profit or changing the cost basis then is the final option you
mentioned.
I attempted the following transaction and receive an error "Too many
missing numbers for currency group 'USD'" .
2025-01-03 * "transfer"
Assets:Broker1:STOCK -20.00 STOCK {}
Assets:Broker2:STOCK 20.00 STOCK {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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/beancount/17b9f2d5-b0b7-4f02-9092-008c03ce937an%40googlegroups.com.