I kind of figured it out - one has to specify another cost basis and use PnL 
account to "absord" the difference:


2019-01-01 * "ACATS"
  Assets:BrokerA:Positions                    -30 ADSK {}
  Assets:BrokerB:Positions                     30 ADSK {170.00 USD}
  Income:PnL


This becomes:


2019-01-01 * "ACATS"
  Assets:BrokerA:Positions       -10 ADSK {100.00 USD, 2017-02-01}
  Assets:BrokerA:Positions       -20 ADSK {110.00 USD, 2017-03-01}
  Assets:BrokerB:Positions        30 ADSK {170.00 USD, 2019-01-01}
  Income:PnL                -1900.00 USD                          


This essentially liquidates and re-purchases all the stocks. I am not aware if 
there is another way that preserves the original cost basis. But I'm okay with 
this method now.

-- 
Zhuoyun Wei

On Wed, May 1, 2019, at 04:30, Zhuoyun Wei wrote:
> Hi,
> 
> I am trying to move my stocks to another broker with ACATS. The 
> transfer was a success, but I do not know how to record it in 
> Beancount. Here is a minimal bean file:
> 
> 
> option "operating_currency" "USD"
> 1970-01-01 open Assets:Bank:Checking
> 1970-01-01 open Assets:BrokerA:Cash
> 1970-01-01 open Assets:BrokerA:Positions "FIFO"
> 1970-01-01 open Assets:BrokerB:Cash
> 1970-01-01 open Assets:BrokerB:Positions "FIFO"
> 1970-01-01 open Equity:Transfers
> 
> 2017-01-01 * "ACH transfer to BrokerA"
>   Assets:Bank:Checking                     -10000.00 USD
>   Equity:Transfers
> 
> 2017-01-05 * "Incoming ACH transfer"
>   Equity:Transfers
>   Assets:BrokerA:Cash                       10000.00 USD
> 
> 2017-02-01 * "Buy 10 ADSK"
>   Assets:BrokerA:Cash
>   Assets:BrokerA:Positions                     10 ADSK {100.00 USD}
> 
> 2017-03-01 * "Buy 20 ADSK"
>   Assets:BrokerA:Cash
>   Assets:BrokerA:Positions                     20 ADSK {110.00 USD}
> 
> 2019-01-01 price ADSK                         170.00 USD
> 
> 2019-01-01 * "ACATS out"
>   Assets:BrokerA:Positions                -30 ADSK {}
>   Assets:BrokerA:Cash                      -13200.00 USD
>   Equity:Transfers
> 
> 2019-01-05 * "ACATS in"
>   Equity:Transfers
>   Assets:BrokerB:Positions                   30 ADSK {}
>   Assets:BrokerB:Cash                       13200.00 USD
> 
> 
> I realize the "ACATS in" transaction may be incorrect, but even the 
> "ACATS out" transaction raises an error:
> 
> acats.bean:33:      Too many missing numbers for currency group 'USD'
> 
> I have tried various ways to amend the transaction with no success. 
> Even if I tried to move only the positions directly to another broker, 
> it does not work:
> 
> 2019-01-01 * "ACATS out"
>   Assets:BrokerA:Positions                -30 ADSK {}
>   Assets:BrokerB:Positions
> 
> ^ this raises a "Too many missing numbers for currency group 'USD'" error.
> 
> Another attempt was:
> 
> 2019-01-01 * "ACATS out"
>   Assets:BrokerA:Positions                -30 ADSK {}
>   Assets:BrokerB:Positions                 30 ADSK {}
> 
> ^ this raises two errors:
> 
> acats.bean:29:      Failed to categorize posting 2
> acats.bean:32:      Too many missing numbers for currency group 'USD'
> 
> 
> Could anyone tell me the proper way to move positions, please?
> 
> -- 
> Zhuoyun Wei

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/ad1182d8-948d-4b45-9984-423ec9f98792%40www.fastmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to