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

How to use it with Schwab Equity JSON? #583

Open
DimitryDushkin opened this issue Jan 7, 2025 · 5 comments
Open

How to use it with Schwab Equity JSON? #583

DimitryDushkin opened this issue Jan 7, 2025 · 5 comments

Comments

@DimitryDushkin
Copy link

How --schwab_equity_award_json is intendant to be used? It seems it's not working no matter do I provide along --schwab-award some.csv or not. If I do not provide argument --schwab_equity_award_json and use just CSVs for transactions and awards it's working fine.

If I provide both like cgt-calc --year 2023 --schwab ./Individual_XXX996_Transactions.csv --schwab-award ./EquityAwardsCenter_Transactions.csv --schwab_equity_award_json ./EquityAwardsCenter_Transactions.json there is an error:

  File "/root/.local/share/pipx/venvs/cgt-calc/lib/python3.11/site-packages/cgt_calc/parsers/schwab_equity_award_json.py", line 151, in action_from_str
    raise ParsingError("schwab transactions", f"Unknown action: {label}")
cgt_calc.exceptions.ParsingError: While parsing schwab transactions, Unknown action: Lapse

If I provide only transactions and schwab_equity_award_json like like cgt-calc --year 2023 --schwab ./Individual_XXX996_Transactions.csv --schwab_equity_award_json ./EquityAwardsCenter_Transactions.json the error is

KeyError: 'Award price is not found for symbol SOMETHING for date 2024-11-15'

but clearly the entry for equity is in JSON.

I looked at code a bit and it seems the code is not organized to work without equity CSV file provided and this error above comes way before equity JSON file parsing. So this made me wonder what I'm doing wrong using JSON? :)

@vmartinv
Copy link
Collaborator

vmartinv commented Jan 8, 2025 via email

@DimitryDushkin
Copy link
Author

And what happens if you provide the csv awards only?

Not much. Running cgt-calc --year 2023 --schwab_equity_award_json ./for_computations/EquityAwardsCenter_Transactions.json returns same error:

cgt_calc.exceptions.ParsingError: While parsing schwab transactions, Unknown action: Lapse

@vmartinv
Copy link
Collaborator

vmartinv commented Jan 9, 2025

That’s just the json. I asked about the awards in csv format and the normal transactions.

@ReX1983
Copy link

ReX1983 commented Jan 17, 2025

@DimitryDushkin did you manage to get it to work? If so, do you mind sharing the command line used?

@berdario
Copy link

berdario commented Jan 24, 2025

I think that --schwab never really worked together with --schwab_equity_award_json

In fact, while schwab_equity_award_json.py has a bit of documentation at the top, which explains how to get the source data from Schwab, schwab.py doesn't. Before noting that Dimitry's command contains --schwab-award ./EquityAwardsCenter_Transactions.csv I even had no idea of which file and which format that flag expected.

Personally, if I try to pass in all 3 flags, I get a different error:

cgt_calc.exceptions.ParsingError: While parsing equity-awards.csv, Missing columns in awards file: {'FairMarketValuePrice'}

My schwab .csv don't contain a FairMarketValuePrice in their header, but they do contain SubscriptionFairMarketValue, PurchaseFairMarketValue, PurchaseFairMarketValue.

About how to use --schwab_equity_award_json: The way that I've always used it (and in which it continues to work), is to use it on its own (without --schwab or --schwab-award). In fact, I didn't see this error before 1 year ago because I hadn't yet enrolled in an automated trading plan (like 10b5-1) (and so, most/all of the interesting transactions, were the vesting transactions in the Equity account).

Personally, using --schwab_equity_award_json on its own is fine, since when enrolling in the trading plan I also disposed of all my vested stocks (and I never used Schwab to purchase any stock), so my pool is empty (and thus, computing capital gain in the Individual account can just be done separately and it's much simpler)

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

4 participants