New issue 364: Cost basis Fold (#) is broken or unintuitive for short sales
https://bitbucket.org/blais/beancount/issues/364/cost-basis-fold-is-broken-or-unintuitive

Adam Wolenc:

```
#!python


2018-10-31 * "Sold Short 23 MSFT @ 106.935"
  Assets:TDA:Main:Cash            2452.53 USD
  Assets:TDA:Main:MSFT                -23 MSFT {106.935 # 6.98 USD}

2018-12-21 * "Bought to Cover 23 MSFT @ 98.25"
  Income:PnL:ShortTerm
  Assets:TDA:Main:Cash           -2266.70 USD
  Assets:TDA:Main:MSFT                 23 MSFT {} @ 98.25 USD
  Expenses:Financial:Commission      6.95 USD

2018-11-12 * "Bought 100 PCG @ 31.15"
  Assets:TDA:Main:Cash           -3121.95 USD
  Assets:TDA:Main:PCG                 100 PCG {31.15 # 6.95 USD}

2018-11-12 * "Sold 100 PCG @ 33.33"
  Income:PnL:ShortTerm
  Assets:TDA:Main:Cash            3326.00 USD
  Assets:TDA:Main:PCG                -100 PCG {} @ 33.33 USD
  Expenses:Financial:Commission      6.95 USD
  Expenses:Taxes:RegFee              0.05 USD

```

In the above example, folded cost basis works correctly for PCG.
But the MSFT position, a short sale, bails on
```
t:13:      Cost is negative: 
"Cost(number=Decimal('-106.6315217391304347826086957'), currency='USD', 
date=datetime.date(2018, 10, 31), label=None)"

t:18:      Cost is negative: 
"Cost(number=Decimal('-106.6315217391304347826086957'), currency='USD', 
date=datetime.date(2018, 10, 31), label=None)"

t:11:      Transaction does not balance: (4905.055000000000000000000001 USD)

   2018-10-31 * "Sold Short 23 MSFT @ 106.935"
     Assets:TDA:Main:Cash  2452.53 USD                                          
        
     Assets:TDA:Main:MSFT      -23 MSFT {-106.6315217391304347826086957 USD, 
2018-10-31}
```


-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20190120025656.29460.62990%40app-147.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to