>>>>> Martin Michlmayr <[email protected]> writes:

> I can fix this up by accounting for the capital loss made when buying
> something worth $100 for $200:

> 2012-03-17 * Test
>    A 10 AAPL {$10} @ $20 B -$200 Expenses:Capital loss $100

Yes, this is the current behavior.  The fact that you are building something
for $20 a share whose price is $10 a share makes Ledger want to know to which
account that lost $100 went.  Otherwise, it would seem to have simply
evaporated.

> But is this always true?  Is the amount in {} always the price and the
> amount after @ the cost?  This seems exactly opposite to what I would expect
> when selling something.

Yes, this is always true.

> Let's say I have 1 AAPL which I bought at $10 and now I sell it for $20.
> I'd say:
>     Assets:Investments -1 AAPL {$10.00} @ $20.00

> What is the price and what the cost?  Is $10 really the price and $20 the
> cost according to ledger?  I'd expect the exact opposite.  ledger -B shows
> $-20 while -I shows $-10.

The shares you are selling *had* a price of $10, and you are selling them at a
(negative) cost to you of $-20.  Price is always an attribute of the
_commodity_, while cost is always an attribute of the _posting_.

These may not be the 100% correct terms in all situations, but I had to pick
two words to use, and I always differentiate them this way.

> -B stands for cost basis and the cost basis is what I paid for something,
> not what I received for it.

That could be right, in which case my naming is incorrect there.  --cost is a
synonym for -B, btw, in case that makes more sense.

John

Reply via email to