On Wed, Jan 25, 2017 at 12:32 AM, Martin Michlmayr <t...@cyrius.com> wrote:

> * Martin Blais <bl...@furius.ca> [2017-01-25 00:07]:
> > > > 2012-04-10 My Broker
> > > >     Assets:Brokerage:Cash       $750.00
> > > >     Assets:Brokerage            -10 AAPL {$50.00} @ $75.00
> > > >     Income:Capital Gains
> > > >
> > > > and now Ledger correctly reports the realized gain of $250.00.
> > > > So far, so good. What I find it surprising is that also this one
> > > > balances:
> > > >
> > > > 2012-04-10 My Broker
> > > >     Assets:Brokerage:Cash       $750.00
> > > >     Assets:Brokerage            -10 AAPL {$50.00} @ $90.00
> > > >     Income:Capital Gains
> > > >
> > > > and gives exactly the same result (ledger reg --lot-prices). So,
> > > > is the @ annotation totally ignored in this context? Is this a
> > > > bug/limitation of Ledger?
> > >
> > > I don't think it's a bug but it's a limitation.  If you take
> > > Assets:Brokerage:Cash and Income:Capital Gains together, you always
> > > get the same value regardless of what the gain is.
> >
> > No. It's neither a bug nor a limitation. If you sold an asset the market
> > values at $90/share and you only received $75 a share for them (i.e., you
> > got ripped off), your profit is $75, not $90. That's the correct number.
>
> I'm not sure I follow what you're saying.  In particular, I think it's
> wrong to say "your profit is $75".  It's not $75 in any of the
> examples.  It's either $25 or $40.
>

Yes, I meant $25.  Proceeds $75, profit $25.



> Anyway, you assume that the person actually received $750 on their
> brokerage cash account wheras I assumed that this figure was
> incorrect.
>

Well if it was imported from a statement how can it be incorrect?
Usually the statement has the cash amount, the sales price and the number
of units. The cost basis is normally on the user to figure out (which is
where automating the booking methods help). The capital gains is typically
not reported.



>
> So what I was saying is that the second transaction should be:
>
> 2012-04-10 My Broker
>      Assets:Brokerage:Cash       $900.00
>      Assets:Brokerage            -10 AAPL {$50.00} @ $90.00
>      Income:Capital Gains       -$400.00
>

That makes sense.



> Whereas in your example, we have:
>
> 2012-04-10 My Broker
>      Assets:Brokerage:Cash       $750.00
>      Expenses:HighwayRobbery     $150.00
>      Assets:Brokerage            -10 AAPL {$50.00} @ $90.00
>      Income:Capital Gains       -$400.00
>
> But capital gains is still $400.  Why?  Because you sold AAPL bought
> for $50 for $90, making $40 profit each.  And you sold 10 of them.
>
> For tax purposes, can you subtract the HighwayRobbery expenses?
> Probably, but imho that's a different question.
>

Yes, that's like a commission or a fee. Different topic. The only way to
really handle these in Ledger/Beancount AFAIK is to subtract the fees from
the gains as a post-process. I do this with custom scripts in the few
places I really need to (mainly to reproduce some stock statements I care
about precisely).


> In your second example, you'll see that Income:Capital Gains is
> > > incorrect (it's -$250 instead of -$400).  If you fix it, you'll
> > > end up with the correct amount for Assets:Brokerage:Cash.
> >
> > Where does the money come from?
>
> ($90 - $50 ) * 10 is the capital gain, I don't think you can argue
> about that.
>

It's not if you don't receive $900 of stuff (assets, expenses or otherwise)
in exchange for it.

The bottom line is that it doesn't matter what the market price was if
that's not what you actually paid. To be consistent, the price attached to
that annotation should be the one you paid, but for Ledger/Beancount, we
don't care, we just ignore it (you can put the market price if you like,
it's an annotation, at best it goes to fill up the price database), we use
the cash amounts instead, which are the ground truth. In Beancount you can
give it meaning by using the sellgains plugin which verifies it (and so
then you have to put the price you actually paid), so that there are really
two balances checks in each transaction, one using the cost, and one using
the price.


Whether some of the money is lost on some other expense may be a
> different matter.
>

If you balance against $900 then that works for me.



--
> Martin Michlmayr
> http://www.cyrius.com/
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Ledger" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ledger-cli+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to