Skip to content

Bug in expired short option position from Vanguard #105

@emin63

Description

@emin63

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:

<INVTRAN><FITID>112283661<DTTRADE>20200430160000.000[-5:EST]
<DTSETTLE>20200501160000.000[-5:EST]<MEMO>SELL</INVTRAN>
<SECID><UNIQUEID>Z9713494Z<UNIQUEIDTYPE>CUSIP</SECID>
<UNITS>-20.0<UNITPRICE>0.25<COMMISSION>20.0<FEES>0.01
<TOTAL>479.99<SUBACCTSEC>CASH<SUBACCTFUND>CASH</INVSELL><OPTSELLTYPE>SELLTOCLOSE<SHPERCTRCT>0</SELLOPT>
... lots of random stuff
<OPTINFO>
  <SECINFO><SECID><UNIQUEID>Z9713494Z<UNIQUEIDTYPE>CUSIP</SECID>
  <SECNAME>PUT QEP RESOURCES INC $1<TICKER>Z9713494Z<MEMO>SELL</SECINFO>
  <OPTTYPE>PUT<STRIKEPRICE>0.0<DTEXPIRE>20200515160000[-5:EST]
  <SHPERCTRCT>0
</OPTINFO>

I end up seeing something like the following in the output:

2020/04/30=2020/05/01 SELL
    Vanguard:27467766                           -20.0 "Z9713494Z" @ $0.25
    ; ofxid: 15103.27467766.112283661
    Assets:Unknown                                          $5.00

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 in converter.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions