Hello, I have been reading through docs and trying to make heads or tails of how to do this operation. Recently I consolidated retirement accounts. As part of this process my holdings were transferred over directly from one account to the other. I am sure I am misunderstanding something but I have been testing various methods for a while and cannot figure out the right way to approach this problem. Any recommendations for ways to reframe the problem or think about it differently instead of just accomplishing the immediate goal are welcome and encouraged.
It may be as simple as my misunderstanding price/cost or the cost and market value views in fava. I could also be drastically over complicating things. Thank you all in advance for your help! Below is an initial state beancount file to provide a minimal example. I have also included two examples of some potential transfer transactions to append to the setup file and the reasons why they dont really work.Broker1 is set up as "NONE" bookkeeping due to the way the broker provided statements. This was a major motivator for migrating to Broker2.option "operating_currency" "USD"
2024-01-01 open Assets:BankAccount
2024-01-01 open Equity:Opening-Balances
2024-01-02 pad Assets:BankAccount Equity:Opening-Balances
2024-01-03 balance Assets:BankAccount 100 USD
2024-12-31 open Assets:Broker1:STOCK "NONE"
2024-12-31 open Assets:Broker2:STOCK
2025-01-01 * "invest 1"
Assets:Broker1:STOCK 10.00 STOCK {1.00 USD}
Assets:BankAccount -10.00 USD
2025-01-02 * "invest 2"
Assets:Broker1:STOCK 10.00 STOCK {2.00 USD}
Assets:BankAccount -20.00 USD
Example 1:2025-01-03 * "transfer"
Assets:Broker1:STOCK -10.00 STOCK {}
Assets:Broker2:STOCK 10 STOCKHere is one attempt I have tried. It sort of works in that there are no errors shown in fava but in the cost and market value views it doesnt convert to USD.
Example 2:
2025-01-03 * "transfer"
Assets:Broker1:STOCK -20.00 STOCK {USD}
Assets:Broker2:STOCK 20 STOCK {{40.00 USD}}Another attempt I have made is to change the transfer according to the syntax defined in github issue 476. If I do not specify the cost of the stock in broker 2 I get an error stating the transaction is not balanced. However if I do specify the current price/cost of the stock it seems to show that there has been a $10 negative balance to Broker 1. In the MarketValue view this shows correctly..
Example 3:
2025-01-03 * "transfer"
Assets:Broker1:STOCK -20.00 STOCK {} @ 2.00 USD
Assets:Broker2:STOCK 20.00 STOCK {{40.00 USD}}Income:Investment -10.00 USDThis option resolves the confusion in both the cost and market value views. However now we are including a sort of fake income that we havent actually realized.
It also requires that we know the exact amount of that income because leaving the specific value blank to try to soak up any income results in the error Too many missing numbers for currency group 'USD', In my case I dont know the exact income value for each of the stocks coming over from broker1 to broker 2 because it is a retirement account and is basically using average bookkeeping.
--
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 view this discussion visit https://groups.google.com/d/msgid/beancount/d798059c-af75-4622-b5c8-adb0a7666154n%40googlegroups.com.
Here’s a plugin that does what you want. But more interestingly, the README on that page explains and shows you how to do it.
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}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:
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}To view this discussion visit https://groups.google.com/d/msgid/beancount/c5781530-b8fd-48be-921f-8b96bb13d9c0n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/beancount/23b5de54-f44e-4f6d-9993-8e8c0f12476en%40googlegroups.com.
Here’s a plugin that does what you want. But more interestingly, the README on that page explains and shows you how to do it.
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}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:
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.
Glad it helped! As you already mentioned, the underlying concepts of how lot matching is done or not are a good idea to understand. In addition, how those concepts are exercised based on your Beancount transaction syntax would be very helpful. The good thing is, documentation for all those things is excellent with Beancount.
With STRICT booking, if you augment (buy) 30 AAPL, then reduce (sell) -20 AAPL, the reduction will have to to be matched to the existing 30, and will specifically reduce 20 out of the 30.
With NONE booking, if you do the same augment and reduction, then see this doc:
However, there is another way to deal with non-taxable accounts in the meantime: you can simply disable the booking. There is a booking method called “NONE” which implements a very liberal strategy which accepts any new lot.. New lots are always appended unconditionally to the inventory. Using this strategy on the transactions from the previous section would result in this inventory:
units ccy cost cost-ccy lot-date label 45.0045 VBMPX {11.11 USD, 2016-07-28, None} 54.5951 VBMPX {10.99 USD, 2016-10-12, None} -1.4154 VBMPX {10.59 USD, 2016-12-30, None}Observe how the resulting inventory has a mix of signs; normally this is not allowed, but it is tolerated under this degenerate booking method. Note that under this method, the only meaningful values are the total number of units and the total or average cost amounts. The individual lots aren’t really lots, they only represent the list of all postings made to that account.
Here’s a plugin that does what you want. But more interestingly, the README on that page explains and shows you how to do it.
I tried to create a plugin myself but ended up just creating a script that created the transfers.
You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/C8dpE9M61Qo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/beancount/2f8baef4-46cf-4663-ad0c-963b64e95742n%40googlegroups.com.