When trying to use the book_algorithm option, I get an error: Invalid option: 'booking_algorithm' . I installed beancount from repository (hg id shows 5e2dcbfc81b1) using pip install. Not sure what I'm doing wrong.
The head of beancount file verbatim is: ;; -*- mode: org; mode: beancount; coding: utf-8; fill-column: 400; -*- option "title" "Trading" option "operating_currency" "CAD" option "booking_algorithm" "FULL" 2016-01-01 open Assets:Broker:Cash CAD 2016-01-01 open Equity:OpeningBalance CAD 2016-01-01 open Assets:Broker:ABC ABC "FIFO" 2016-01-01 open Income:Broker:PnL CAD In some accounts I don't need to report capital gains so I'm very happy to use LIFO or FIFO approach strctly for personal record keeping of profit/loss. So if I could get the booking_algorithm working that solves half of my problems. For other accounts subject to capital gains in Canada I need to keep track of "Adjusted" cost. First type of adjustment is averaging the price of stock when you buy more (http://www.adjustedcostbase.ca/blog/how-to-calculate-adjusted-cost-base-acb-and-capital-gains/ although this formula includes broker fees in the cost adjustment I think it all still works out if I record those fees separately as Expense). Other types of cost adjustments involve return of capital by an exchange traded fund (ETF) (http://www.adjustedcostbase.ca/blog/return-of-capital-and-how-it-affects-adjusted-cost-base/) which decreases the cost basis uniformly for all units owned, and reinvested distribution which increases the cost basis uniformly accross all units owned (http://www.adjustedcostbase.ca/blog/phantom-distributions-and-their-effect-on-adjusted-cost-base/). I'm trying to figure out a way to keep track of the adjustments above in dual-entry ledger in general, and in beancount in particular. 2015-01-01 * "Opening Balance" Assets:Broker:Cash 1000 CAD Equity:OpeningBalance -1000 CAD 2015-01-01 * "Purchase abc" Assets:Broker:Cash -1100 CAD Assets:Broker:ABC 100 ABC {11.0 CAD} 2015-01-02 * "Purchase abc" Assets:Broker:Cash -1000 CAD Assets:Broker:ABC 100 ABC {10.0 CAD} 2015-01-02 * "Return of capital (1 cent per share)" Assets:Broker:ABC -100 ABC {10 CAD) Assets:Broker:ABC -100 ABC {11 CAD) Assets:Broker:ABC 100 ABC {10.50 CAD} 2016-01-11 * "Selling some ABC" Assets:Broker:ABC -100 ABC {10 CAD} ; this can be {*} or nothing when FIFO works? Assets:Broker:Cash 500.05 CAD Income:Broker:PnL Thanks for any suggestions. On Friday, October 14, 2016 at 7:00:12 PM UTC-4, Martin Blais wrote: > > On Fri, Oct 14, 2016 at 4:58 PM, <[email protected] <javascript:>> wrote: > >> Hi, >> >> Thank you for writing beancount as well as exellent documentation in >> terms of introduction to accounting and beancount as a software package. I >> have read several of them like Getting Started Guide, Trading with >> Beancount, Cookbook. I still have a few questions as I'm coming to grips >> with using the software effectively. >> >> Is there a way to define default currency so I don't have to enter it >> beside a very large portion (over 50%) of entries? >> > > Beancount does not have a concept of "default currency". > > > When selling stocks, is there a quick way to generate credit entries for >> the stocks with their book vaule? For example if I purchase a stock 10 >> times, 20 stocks at a time, when I want to record the sale of 181 units I >> need to track down all previous purchases to figure out book value of each, >> and type 10 with book value in {}. What's the quickest way to make this >> type of entry? If there's an "automatic" way to express this in beancount >> language assume I don't care how stocks are picked - LIFO or FIFO. >> > > Yes; see the booking_algorithm to FULL and make the default booking method > on those accounts to e.g. "FIFO". Like this: > > option "booking_algorithm" "FULL" > > ... > > 2015-01-01 open Assets:JTrade:MSFT MSFT "FIFO" > > The new, "FULL" booking algorithm (as opposed to the older "SIMPLE", > inferior one) will become the default at some point hopefully soon (I > started to make that happen earlier this week but I still need to port a > number of unit tests over to it). > > > >> I need to calculate adjusted cost base in some cases when selling stock. >> > > "Adjusted" is a heavily overloaded term. Could you be more specific? > > > >> Does anyone have any suggestions on the most effective way to do ths? >> For example can you help me write a query/report to generate book value for >> each purchase trade, since the last time stock count was 0. The reason I >> had 0 in there is for example if I purchase 5 stock, sell 5 stock, purchase >> 10 stock, then another 10. I'm only interested in the last 2 transactions >> for this calculation, the fact that I previously had 5 stock at some price >> is not relevant to current ACB calculation. >> > > If you had this pattern, after the sale of 5 you'd have an empty > inventory. Sales further on could only match on more recent purchases. > > Tell us what ACB calculation you'd expect and we can help. > > Once the booking_algorithm will be "FULL" by default I plan to > automatically add metadata to link buy/sell pairs so you can easily produce > lists of trades by any period. > > > > Thank you. >> >> >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/beancount/cb10e18b-6711-48e6-b301-5ebe8131080f%40googlegroups.com >> >> <https://groups.google.com/d/msgid/beancount/cb10e18b-6711-48e6-b301-5ebe8131080f%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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/9b828ca0-2ea1-4fad-8530-5d399c904780%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
