Open emin63 opened 4 years ago
Probably we need to add something here: https://github.com/egh/ledger-autosync/blob/master/ledgerautosync/converter.py#L487
To be honest that kind of transaction is beyond me. What output would you expect to see for this kind of transaction?
To be honest that kind of transaction is beyond me.
Fair enough. Selling puts is often a stupid thing to do anyway so you could argue not supporting it is doing people a favor. :)
What output would you expect to see for this kind of transaction?
I want a transaction so that when the assignment happens the option position goes away. The first transaction below is what ledger-autosync produces for buying the stock (which is correct). The second transaction is what I manually added to fix things to note that the option position goes away.
2020/05/15=2020/05/19 BUY
Vanguard Brokerage Account 2000.0 QEP @ $1.0
; ofxid: 15103.27467766.586242039
Assets:Unknown -$2000.00
2020/05/15=2020/05/19 OPTION ASSIGNED
Vanguard Brokerage Account 20.00 "Z9713494Z" @ $0.0
; manual fix due to bug discussed in github issue 105 of ledger-autosync
Assets:Unknown $0.00
Thanks for the example! Is the only information about the put available in the SECINFO
part? Is there only the one sell transaction in the OFX file? I'm not sure if l-a is not getting enough information from the https://github.com/jseutter/ofxparse library, or if it just isn't doing the right thing with the data it's getting.
I think there is a bug in processing expired short option positions from Vanguard.
What happened is I sold 20 puts for $0.25 and they were assigned to me (i.e., the person who bought the puts exercised them early and sold me 2000 shares of stock). The buy of 2000 shares shows up correctly but the short puts never go away.
Below is an example of what ofxclient is downloading which ledger-autosync is having trouble parsing:
I end up seeing something like the following in the output:
which is the opening position where I sell the puts but the
"Z9713494Z"
position never gets closed out in the output of ledger-autosync.I can't follow the python code very well but it seems like the second
"Z9713494Z"
transaction is ignored inconverter.py
.This may well be a bug in Vanguard's OFX output but it seems odd that
converter.py
isn't even seeing the second"Z9713494Z"
transaction.