Here's how I do it. I got this from this mailing list a while ago.
Putting the commission into the 'AAPL' account allows for the realized
gain to be calculated properly.

The SELL transaction is more complicated, in order to make sure that
the gain or loss on the transaction gets captured into a 'Capital
Gains' account. It's easy enough for single buys and sells, but gets
hairy when you've had multiple buys (e.g. dollar cost averaging)

;; Transfer money to my brokerage

1998/05/01
    Assets:Investments:Scottrade        $1,000.00
    Assets:Banking:Suntrust

;; Buy AAPL

1998/05/05 BUY AAPL
    Assets:Investments:Scottrade:AAPL   10 AAPL @ $29.25
    Assets:Investments:Scottrade:AAPL         $14.95  ; commission
    Assets:Investments:Scottrade

;; Sell AAPL

1999/08/16 SELL AAPL
    Assets:Investments:Scottrade:AAPL   -10 AAPL @ $29.25 ; buy price
    Assets:Investments:Scottrade:AAPL   10 AAPL @ $60.375 ; sell price
    Assets:Investments:Scottrade:AAPL   -10 AAPL @ $60.375
    Assets:Investments:Scottrade:AAPL        $-14.95  ; buy commission
    Income:Capital Gains:LT                   $14.98  ; sell
commission
    Assets:Investments:Scottrade             $588.77
    Income:Capital Gains:LT

Hope that helps get you started...

Vinod


On Apr 24, 7:58 am, Tim Docker <[email protected]> wrote:
> Oops - I missed the fact that writing "50 AAPL @ $30" is an
> entry only for AAPl - it doesn't affect the $. So it appears
> you need to book the cashflow separately, and can hence refer
> to a different account ie:
>
> 2004/05/01 * AAPL Purchase.
>   Assets:Stocks              50 AAPL @ $30.00
>   Assets:Trading Account     $-1500
>   Market:Stocks
>
> But I'm still interested in how others do this, and whether I need
> to be manually calculating the total cash.
>
> Tim
>
> On Apr 24, 12:35 pm, Tim Docker <[email protected]> wrote:
>
> > a stock purchase/sale. Is there a convention for this?
>
> > The ledger sample file shows 50 AAPL @ $30, but in that case it's
> > credited against "Equity", and the manual suggests that the Equity
> > account should be reserved for initial balances.
>
> > Should I have a new top level account for the market(ie different
> > to Equity,Assets,Income, and Expenses)? ie something like:
>
> > 2004/05/01 * Investment balance
> >   Assets:Brokerage              50 AAPL @ $30.00
> >   Market:Stock
>
> > This doesn't feel quite right. What do others do? I guess the
> > approach would be the same for the purchase of any asset which
> > has ongoing value.
>
> > Also, is it possible to get the dollars paid and shared received
> > to go to separate sub accounts? I could do something like:
>
> > 2004/05/01 * Investment balance
> >   Assets:Stocks              50 AAPL @ $30.00
> >   Assets:Stocks              $1500
> >   Assets:Trading Account     $-1500
> >   Market:Stock
>
> > but it seems messy to have to manually calculate the transfer
> > amount.
>
> > Any tips or pointers would be appreciated.
>
> > Tim
>
>

Reply via email to