Hi Matthias,
> On Jun 7, 2015, at 12:39 PM,
ma.k...@gmail.com wrote:
> I know that hledger doesn't have fluctuating prices and I am not asking for functionality where I can ask for a balance and have AAPL recorded at some intermediate price (e.g. 40, halfway). I would be satisfied to record a gain on the sale at same point. Something like the following may work initially as well.
>
> 2004/05/01 Stock purchase
> Assets:Broker 50 AAPL
> Assets:Broker $-1500
>
> 2005/08/01 Stock sale
> Assets:Broker -50 AAPL
> Income:Capital Gains $-1,000.00
> Assets:Broker $2500
>
> Nobody here who tracks stock trades with hledger, is there? I'm open to other ways of entering this as well.
That seems quite reasonable, I don't know any reason why it couldn't be handled something like that, if you don't need to calculate values at other points in time.
> Regarding Issue 131: I am not sure I can fully understand the pains the folks are having with their abroad consumption. Creating additional account just so I can balance out the AAPL that I buy seems unnatural and cumbersome. In particular, I'd also expect the balance summary to show that I am in fact holding 50 AAPL instead of the zeroing out everything. As far as I am concerned, my example balances to zero. You consider AAPL at the purchase price and it zeros out. When you sell it, you add income to a capital gains account and it balances again. If you track prices along the way, you balance via an unrealized gains account.
> I'm not sure -X would help with this. I don't want all my accounts to be summarized in AAPL currency. Would it?
> What about the simpler trading scenario that I describe? Is is feasible?
In all honesty I'm not clear on this myself. I tend to get clear only when I try to model some real-world case in my own finances, or someone writes up a description of their situation that's really concrete and minimal. So discussions like this are quite helpful.
I think Ledger has these features interacting:
1. The -X flag converts all amounts to a chosen commodity (for which conversion prices are known as of the report date).
2. The -V flag is like -X but automatically selects the target commodity, in some magic hard-to-explain way according to the Ledger manual. I ignore it for now.
3. The P directive allows conversion prices to be recorded on additional dates, without needing transactions. This makes -X more useful when prices are fluctuating, because you can calculate commodity conversions more accurately on arbitrary dates.
4. If -X (or -V) is in effect, then whenever a price changes (due to a P directive, or being specified within a transaction), a "Commodities revalued" transaction is automatically generated on that date. These are displayed by the Ledger's register command, and also by print (but without the postings, which seems wrong).
5. The -B flag converts posting amounts which have a price attached, to that price's commodity. It isn't affected by P directives.
Did I get it right ?