One clarification: over lunch I was thinking about this, and realized that 
beancount does FIFO booking reductions correctly for securities like stocks 
under the usually valid assumption  a security is sold/ reduced in the same 
currency it was purchased in, since each security is denominated in the 
currency of its exchange.  This is reasonable: if one buys shares in Nokia 
(NOK) listed on the New York Stock Exchange, they're always listed in USD. 
Shares listed in EUR are available on the Helsinki Stock Exchange, but 
their symbol is NOKIA, hence a different security. 

Where thinks currently seem not to work is if one is tracking a real 
commodity -- apples, bitcoin, or coffee -- anything that doesn't have an 
intrinsic currency for valuing it. 

Does that make sense, or have I misunderstood something? 

Thanks for all you work on beancount. It's a great tool! 

Joel 

Le samedi 19 août 2017 11:38:11 UTC+2, Joel a écrit :
>
> Thanks for your response.
>
>
>>> 2. If I explicitly put "USD" in all my empty {}, how does will FIFO 
>>> booking option handle the occasional cases where I've purchased bitcoin 
>>> with euros? 
>>>
>>
>> I don't understand the question. If you try to reduce and provide USD in 
>> the description, it will only match against lots in USD. Can you provide an 
>> example pair of transactions?
>>
>>
>>  
>>
>>> Will it always reduce the oldest bitcoin lots first, regardless of the 
>>> currency I'm reducing with, or will explicitly specifying the reducing 
>>> currency mean I have to manually check the order lots are cleared to make 
>>> sure that the total of the two currencies reduces correctly per FIFO?
>>>
>>
>> I'm still not sure I understand, it will never convert currencies when 
>> reducing.
>>
>>
>  Here's an example, from a fictitious episode in which I rode Amtrak back 
> and forth a few times between New York City and Montreal to sell apples:
>
>  
> option "title" "My Personal Ledger"
> option "operating_currency" "USD"
> option "operating_currency" "CAD"
> option "booking_method" "FIFO"
>
> 2016-01-01 open Equity:Opening-Balances
> 2016-01-01 open Assets:US:Cash                    USD                    
> 2016-01-01 open Assets:CA:Cash                    CAD
> 2016-01-01 open Assets:MyBackpack:Stuff        APPLES
> 2016-01-01 open Income:CapitalGains
>
> 2016-05-26  price  CAD   0.77046 USD
> 2016-05-28  price  CAD   0.76761 USD
>
> 2016-05-24 * "Opening Balances"
>   Assets:US:Cash            40.00 USD
>   Assets:CA:Cash             0.00 CAD
>   Equity:Opening-Balances
>
> 2016-05-25 * "Bought some apples in New York"
>   Assets:MyBackpack:Stuff   10 APPLES {1.00 USD}
>   Assets:US:Cash
>
> 2016-05-26 * "Convert USD to CAD"
>   Assets:CA:Cash                 
>   Assets:US:Cash           -15.03 USD @ 1.29792 CAD
>
> 2016-05-26 * "Bought some more apples in Montreal"
>   Assets:MyBackpack:Stuff   13 APPLES {1.50 CAD}
>   Assets:CA:Cash
>
> 2016-05-27 * "Bought some apples in New York"
>   Assets:MyBackpack:Stuff   11 APPLES {1.20 USD}
>   Assets:US:Cash
>
> 2016-05-28 * "Sold some more apples in Montreal"
>   Assets:MyBackpack:Stuff  -14 APPLES {USD} @ 1.70 CAD   ; should sell 10 
> APPLES {1.00 USD} & 4 APPLES {1.50 CAD}, a cost basis of 14.605 USD
>   Assets:CA:Cash            23.80 CAD                    ; converts to 
> 18.269 USD
>   Income:CapitalGains                                    ; revenue (18.269 
> USD) - cost basis (14.605 USD) = 3.665 USD
>
> ; CapitalGains = 3.47 USD per beancount when the {1.50 CAD} lot doesn't 
> get reduced.
>
> I don't think beancount is reducing my apples by FIFO correctly, because 
> when I run the *bean-report *sample *holdings* when selling 14 apples, 
> its reducing from my {1.00 USD, 2016-05-25} and {1.20 USD, 2016-05-27} 
> lots, but not reducing any apples from my {1.50 CAD, 2016-05-26} lot. Since 
> apples are apples, shouldn't it reduce the lots by date order?
>
> If I replace the {USD} with an empty {} beancount tries to reduce all 14 
> sold apples form the {1.50 CAD, 2016-05-26} lot, but fails because there's 
> only 13 apples in that lot. The only was I can find to have beancount 
> reduce my apple inventory selling the oldest lots first is manually, like 
> this:
> 2016-05-28 * "Sold some more apples in Montreal"
>   Assets:MyBackpack:Stuff  -10 APPLES {USD} @ 1.70 CAD
>   Assets:MyBackpack:Stuff   -4 APPLES {CAD} @ 1.70 CAD
>   Assets:CA:Cash            23.80 CAD                    
>   Income:CapitalGains    
>
> So, I'm not sure FIFO is reducing the oldest lots first. It depends on the 
> lot currency.
>
>
>

-- 
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/dc892eed-3ce2-4372-92c3-6decc85ccab0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to