Re: Tracking Short Sales

2020-03-13 Thread John Wiegley
> "BO" == Brandon Olivares  writes:

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

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

Hmm.. what I do is include a note to my entries to distinguish symbols, and
leave accounts to map to their real world counterparts:

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

I then use:

ledger bal --pivot=Symbol -B Equities

However, adding --percent does not work here, because each equity value
represents 100% of its contribution to that symbol...

Interestingly, changing to --group-by='tag("Symbol")' causes Ledger to crash,
which is nice to know.

I do wonder if we can't massage the data from this report somehow to get the
figures out that we need.

John

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2k13oylpe.fsf%40newartisans.com.


Re: Tracking Short Sales

2020-03-13 Thread Brandon Olivares
That’s sort of what I’m thinking of. I tried something like this, and it works 
mathematically but not sure how clear it is. But I like it because it’s very 
obvious that as the stock goes down in price, the short position gains value.

2020/03/12 Short AAPL
Assets:Portfolio:AAPL  -8 AAPL @ $250.00
Assets:Portfolio:Cash  $-2,000.00  ; Set aside collateral
Assets:Portfolio:AAPL:Collateral

The Collateral account gets the cash set aside from the short, plus the cash 
received for actually selling the position.

> On Mar 13, 2020, at 3:49 AM, Jostein Berntsen  wrote:
> 
> On 13.03.20,02:31, Brandon Olivares wrote:
>> 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:FB13 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.00AAPL
>>   $1,700.00AMZN
>>   $3,880.00Cash
>>   $2,015.00FB
>>   $2,200.00GOOGL
>>   $2,205.00NFLX
>> 
>>  $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.
> 
> Would it work to move Cash out of the Portfolio category to something 
> like Assets:Stock:Cash instead? 
> 
> Jostein
> 
> 
> 
> -- 
> 
> --- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ledger-cli/20200313074956.GB27739%40jostein.

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/88E74C4B-33FD-4F27-A805-C36BA41DC35E%40gmail.com.


Re: Tracking Short Sales

2020-03-13 Thread Jostein Berntsen
On 13.03.20,02:31, Brandon Olivares wrote:
> 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:FB13 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.00AAPL
>$1,700.00AMZN
>$3,880.00Cash
>$2,015.00FB
>$2,200.00GOOGL
>$2,205.00NFLX
> 
>   $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.

Would it work to move Cash out of the Portfolio category to something 
like Assets:Stock:Cash instead? 

Jostein



-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20200313074956.GB27739%40jostein.


Tracking Short Sales

2020-03-13 Thread Brandon Olivares
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:FB13 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.00AAPL
   $1,700.00AMZN
   $3,880.00Cash
   $2,015.00FB
   $2,200.00GOOGL
   $2,205.00NFLX

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