-
Notifications
You must be signed in to change notification settings - Fork 16
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
AssertionError: Premium is tax free, assignments not. Found "xx.x" EUR. #45
Comments
The script does sanity checks, so you get notifications if your data might not be handled correctly. The error message comes from line 662 in tw-pnl.py. If you disable this check, what error message comes next? If you can give sample lines to reproduce this error, I might be able to help. If you don't mind, some people even Are you sure that your input data is complete from beginning of all your trades? best regards, Florian La Roche |
Hi Florian,
I have attached the input data with the mail.
Best regards,
Nandeesh
…On Sun, 27 Oct 2024 at 17:55, Florian La Roche ***@***.***> wrote:
The script does sanity checks, so you get notifications if your data might
not be handled correctly.
The error message comes from line 662 in tw-pnl.py. If you disable this
check, what error message comes next?
If you can give sample lines to reproduce this error, I might be able to
help. If you don't mind, some people even
send in their input data via email to me, so I can try to reproduce the
error.
Are you sure that your input data is complete from beginning of all your
trades?
best regards,
Florian La Roche
—
Reply to this email directly, view it on GitHub
<#45 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACORZTD4HLVKCQ3OA7ES4ITZ5UEHTAVCNFSM6AAAAABQV4T322VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBQGA4TONRVGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Current checks about tax free EurUSD-conversion is wrong. Just disabling them should work fine, I'll check best regards, Florian La Roche --- a/tw-pnl.py +++ b/tw-pnl.py @@ -586,7 +586,8 @@ def get_summary(new_wk, orig_wk, tax_output, min_year, max_year): if type in ('Ein/Auszahlung', 'Aktie', 'Aktienfond', 'Mischfond', 'Immobilienfond', 'Sonstiges', 'Long-Option', 'Future'): if bool(tax_free): - raise ValueError(f'tax_free is True for type "{type}". Full row: "{new_wk.iloc[i]}"') + pass + #raise ValueError(f'tax_free is True for type "{type}". Full row: "{new_wk.iloc[i]}"') # Währungsgewinne: stats.loc['Währungsgewinne USD', year] += float(usd_gains) stats.loc['Währungsgewinne USD (steuerfrei)', year] += float(usd_gains_notax) @@ -659,7 +660,8 @@ def get_summary(new_wk, orig_wk, tax_output, min_year, max_year): raise AssertionError(f'Premium is tax free, assignments not. Found "{eur_amount}" EUR.') else: if eur_amount < .0: - raise AssertionError(f'Premium is tax free, assignments not. Found "{eur_amount}" EUR.') + pass + #raise AssertionError(f'Premium is tax free, assignments not. Found "{eur_amount}" EUR.') elif type == 'Ordergebühr': stats.loc['zusätzliche Ordergebühren', year] += pnl elif type == 'Dividende': |
Just looked again more closely: Your input data has on 2023-12-27 8 lines with "Special Dividend". These are the failing lines: 2023-12-27T12:48:34+0100,Receive Deliver,Special Dividend,SELL_TO_OPEN,QQQ 240119P00384780,Equity Option,Special dividend: Open 1.0 QQQ 240119P00384780,123.00,1,123.00,--,0.00,100,QQQ,QQQ,1/19/24,384.78,PUT,,USD 2023-12-27T12:48:34+0100,Receive Deliver,Special Dividend,BUY_TO_CLOSE,QQQ 240119P00385000,Equity Option,Special dividend: Close 1.0 QQQ 240119P00385000,-123.00,1,-123.00,--,0.00,100,QQQ,QQQ,1/19/24,385,PUT,,USD 2023-12-27T12:48:21+0100,Receive Deliver,Special Dividend,BUY_TO_OPEN,QQQ 240119P00379780,Equity Option,Special dividend: Open 1.0 QQQ 240119P00379780,-91.00,1,-91.00,--,0.00,100,QQQ,QQQ,1/19/24,379.78,PUT,,USD 2023-12-27T12:48:21+0100,Receive Deliver,Special Dividend,SELL_TO_CLOSE,QQQ 240119P00380000,Equity Option,Special dividend: Close 1.0 QQQ 240119P00380000,91.00,1,91.00,--,0.00,100,QQQ,QQQ,1/19/24,380,PUT,,USD 2023-12-27T12:47:08+0100,Receive Deliver,Special Dividend,BUY_TO_OPEN,QQQ 240119C00429780,Equity Option,Special dividend: Open 1.0 QQQ 240119C00429780,-33.00,1,-33.00,--,0.00,100,QQQ,QQQ,1/19/24,429.78,CALL,,USD 2023-12-27T12:47:08+0100,Receive Deliver,Special Dividend,SELL_TO_CLOSE,QQQ 240119C00430000,Equity Option,Special dividend: Close 1.0 QQQ 240119C00430000,33.00,1,33.00,--,0.00,100,QQQ,QQQ,1/19/24,430,CALL,,USD 2023-12-27T12:47:03+0100,Receive Deliver,Special Dividend,SELL_TO_OPEN,QQQ 240119C00424780,Equity Option,Special dividend: Open 1.0 QQQ 240119C00424780,53.00,1,53.00,--,0.00,100,QQQ,QQQ,1/19/24,424.78,CALL,,USD 2023-12-27T12:47:03+0100,Receive Deliver,Special Dividend,BUY_TO_CLOSE,QQQ 240119C00425000,Equity Option,Special dividend: Close 1.0 QQQ 240119C00425000,-53.00,1,-53.00,--,0.00,100,QQQ,QQQ,1/19/24,425,CALL,,USD Just deleting those 8 lines and then running the script should work ok. Not sure what those 8 lines should do, maybe best regards, Florian La Roche |
Thank you very much Florian for looking into the issue! I am not sure what do you mean by -
|
I am facing this assertion error. Don't know much context about it. If I comment out this assertion will get error again somewhere. Looks like this tool only works only for IDEAL CASEs!
The text was updated successfully, but these errors were encountered: