Sorry for another question but having trouble with this.

As I said in my last message I’m using ledger to track my portfolio. I have it 
down pretty well, but one thing I can’t figure out is short sales.

It seems simple up front: just something like:

2020/03/13 Sell Short
    Assets:Portfolio:AAPL  -8 AAPL @ $250.00
    Assets:Portfolio:Cash  $2,000.00

Then if I view balance by cost basis, I see Assets:Portfolio:Cash is up by 
$2,000 and Assets:Portfolio:AAPL is -$2,000.

But say I have 5 different stocks, 4 are long and 1 is short. I’d like to 
calculate the percent of each stock in the portfolio.

But if one is negative, there’s no easy way to calculate that.

I was thinking of transferring out of cash the collateral that is held for the 
stock, but it seems to overcomplicate things.

Imagine this file for example:

2020/03/13 Initial Deposit
    Assets:Portfolio:Cash                 $10,000.00
    Equity:Opening Balances

2020/03/13 Buy Facebook
    Assets:Portfolio:FB                        13 FB @ $155.00
    Assets:Portfolio:Cash

2020/03/13 Short Apple
    Assets:Portfolio:AAPL                    -8 AAPL @ $250.00
    Assets:Portfolio:Cash

2020/03/12 Buy Amazon
    Assets:Portfolio:AMZN                     1 AMZN @ $1,700.00
    Assets:Portfolio:Cash

2020/03/13 Buy Netflix
    Assets:Portfolio:NFLX                     7 NFLX @ $315.00
    Assets:Portfolio:Cash

2020/03/13 Buy Google
    Assets:Portfolio:GOOGL                   2 GOOGL @ $1,100.00
    Assets:Portfolio:Cash

Running balance on this looks like:

$ ledger -f portfolio.dat -B balance ^Assets
          $10,000.00  Assets:Portfolio
          $-2,000.00    AAPL
           $1,700.00    AMZN
           $3,880.00    Cash
           $2,015.00    FB
           $2,200.00    GOOGL
           $2,205.00    NFLX
--------------------
          $10,000.00

So each stock is roughly 20% (give or take) of the portfolio. But cash looks 
like it is nearly 40% while AAPL is of course negative by -$2,000.

Just would like a nicer way of looking at this. Ideas? Couldn’t find any 
resources out there about this.

-- 

--- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/42A76D28-FCF6-46E5-993F-BDA306C536EF%40gmail.com.

Reply via email to