Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key Error: Receive Deliver - Expiration on Options #31

Closed
MarLahr opened this issue Nov 21, 2022 · 5 comments
Closed

Key Error: Receive Deliver - Expiration on Options #31

MarLahr opened this issue Nov 21, 2022 · 5 comments

Comments

@MarLahr
Copy link

MarLahr commented Nov 21, 2022

Hi,

I encountered a "KeyError" when processing an expiration on an option.

Traceback:
Traceback

Fields in the transaction-csv
transactions.csv

As a workaround i deleted those lines and ran the program again.
Now it tells me I still have open positions (I have none), but at least the tax income statement gets created correct:
OpenPositions

@laroche
Copy link
Owner

laroche commented Nov 23, 2022

Your CSV transactions should be complete. Your example data shows expiration of options, but you have not
bought or sold any options before. The current code should be fairly good tested with short options, so if
this issue is not resolved by using the complete list of transactions, then you might use long options? (Then
please submit a complete use case for that setup.)

Also the list of open positions should be looked at in detail to check for missing transactions.
(I have seen reports that downloading more than 250 transactions might truncate them. ???)

best regards,

Florian La Roche

@MarLahr
Copy link
Author

MarLahr commented Nov 24, 2022

Hi, thanks for your fast reply.

transaction_history.csv
Here is the complete list of transactions.
With this list i get the KeyError shown above.

They are mostly long options (3 of 4 options are long options) and the report contains less than 250 transactions.
The very first removed option (GOEV on 1/21/22) was bought in 2021. I guess here i need to manually add the transaction from 2021 into the CSV-file, correct?

@laroche
Copy link
Owner

laroche commented Nov 24, 2022

Correct, add the rabnsactions from 2021 with a normal text editor to the end of the file.
(Using a spreadsheet program, the lines are often modified.)

If you combine several transaction files, you have to delete the first line of the files except for the newest date.

Does this work for you now?

best regards from Germany/Stuttgart,

Florian La Roche

@MarLahr
Copy link
Author

MarLahr commented Nov 24, 2022

I exported all trades, so no trade which was done in the year before is missing.

Now everything works fine and I get no errors.

Thank you for the fast reply and solution!

@MarLahr MarLahr closed this as completed Nov 24, 2022
@mark-gulati
Copy link

Thank you, this was useful to me. Maybe worth it to have in a FAQ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants