Thank you Red! The explanation here helped a lot. I think my main issue is 
actually a deeper conceptual issue. I will start a different thread for 
that question though. 

On Friday, June 20, 2025 at 11:13:06 PM UTC-7 Red S wrote:

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} 
​

Simulating average cost booking seems like a good way to do this as well. 
If I do not include the `{}` on the Old account though I end up with -30 
AAPL similar to the result in example 1. Adding the lost selector solves 
this though. 

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/bc303dd7-2c40-454f-914e-212f4bfa38ebn%40googlegroups.com.

Reply via email to