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

Feature/delayed delivery #24

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

avion23
Copy link

@avion23 avion23 commented Sep 18, 2022

Depends on #23

I had trouble with this line:

09/29/2021 12:01 AM | Money Movement | Balance Adjustment |   |   |   | 0 |   |   |   |   | 0.00 | 85.92 | Delayed Delivery_GREE1_Assignment_SEP_17 | Individual...60
-- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | --

Error message was

Transaction Code                                 Money Movement
Transaction Subcode                          Balance Adjustment
Symbol                                                      NaN
Buy/Sell                                                    NaN
Open/Close                                                  NaN
Quantity                                                      0
Expiration Date                                             NaN
Strike                                                      NaN
Call/Put                                                    NaN
Price                                                       NaN
Fees                                                        0.0
Amount                                                    85.92
Description            Delayed Delivery_GREE1_Assignment_SEP_17
Account Reference                               Individual...60
Traceback (most recent call last):
  File "/Users/avion/Documents/programming/accounting/tastyworks-pnl/tw-pnl.py", line 1147, in <module>
    main(sys.argv[1:])
  File "/Users/avion/Documents/programming/accounting/tastyworks-pnl/tw-pnl.py", line 1144, in main
    check(all_wk, output_summary, output_csv, output_excel, tax_output, show, verbose, debug)
  File "/Users/avion/Documents/programming/accounting/tastyworks-pnl/tw-pnl.py", line 769, in check
    check_tcode(tcode, tsubcode, description)
  File "/Users/avion/Documents/programming/accounting/tastyworks-pnl/tw-pnl.py", line 125, in check_tcode
    raise ValueError(f'Unknown Balance Adjustment: {description}')
ValueError: Unknown Balance Adjustment: Delayed Delivery_GREE1_Assignment_SEP_17

It's running now with the attached test data. I'm not sure if that is a taxable event or not?
gree.csv

@laroche
Copy link
Owner

laroche commented Sep 18, 2022

The code for symbol change and stock merger does not actually change the open positions in the fifo,
so this only adds code to read the input csv file until now.

@laroche
Copy link
Owner

laroche commented Sep 18, 2022

Seems the option assignment was recorded 12 days earlier (09/17/2021) and probably the adjustment
is necessary due to the stock merger. ??? Might be some manual adjustment from Tastytrade that is showing up here.

@laroche
Copy link
Owner

laroche commented Sep 18, 2022

I've merged in the first three patches into my repository and also added a link to
your python project for tastyworks tax-reports.

The symbol change and stock merger still need more work to adjust the currently open positions
in the fifo queue.

Thanks a lot for the patches,
greetings from Germany, Stuttgart,

Florian La Roche

@avion23 avion23 force-pushed the feature/delayedDelivery branch 3 times, most recently from b92d2f5 to c4be7bd Compare September 18, 2022 15:43
@avion23
Copy link
Author

avion23 commented Sep 18, 2022

Seems the option assignment was recorded 12 days earlier (09/17/2021) and probably the adjustment is necessary due to the stock merger. ??? Might be some manual adjustment from Tastytrade that is showing up here.

Yes, that time was very chaotic. It was a pump and dump and short interest was very high.

@avion23
Copy link
Author

avion23 commented Sep 18, 2022

The symbol change and stock merger still need more work to adjust the currently open positions
in the fifo queue.

I've merged in the first three patches into my repository and also added a link to your python project for tastyworks tax-reports.

The symbol change and stock merger still need more work to adjust the currently open positions in the fifo queue.

I can see that now. I have heavily reduced this Merge Request because I can see that it's not reviewable otherwise. And half-features don't help.

I can continue to implement some unimplemented features, but I have real problems implementing the stock merge / reverse split / symbol change. Those are all untaxable events, but I don't understand how I can mark them as 'tax_free'. I'll open a separate pull request to explain the problem if I can't make any progress on my own.

@laroche
Copy link
Owner

laroche commented Sep 18, 2022

tax_free is only used as marker for USD changes. Everything else just has "PnL" computed and is grouped into
several "sections" (like short options, long options, stock, etc...).
"symbol change" needs to go through currently open positions and change the symbol name accordingly.
Best similar code is "fifos_split" which computes stock splits only for stocks, but until now not for options.

best regards,

Florian La Roche

@avion23
Copy link
Author

avion23 commented Sep 18, 2022

Best similar code is "fifos_split" which computes stock splits only for stocks, but until now not for options.

Yes! That helps, thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants