Compute dividends from E*Trade
Script: Scripts/EtradeDividends.ps1
Usage:
- Log into E*Trade.
- Go to Stock Plan -> Holdings -> Other Holdings.
- Open the web browser inspector (e.g., press
F12
in Google Chrome). - Use the
Network
tab to record the outgoing HTTP requests. - Optionally click the
Clear
button to get rid of the clutter. - Expand the
Cash
section. AgetCashTransactions.json
should appear in theNetwork
view. - Click
getCashTransactions.json
. The view will change, switch to theResponse
tab. - Copy-paste the contents of that tab, save it as
getCashTransactions.json
. - Run the
./EtradeDividends.ps1
in the directory containing thegetCashTransactions.json
. This can take a while since it asks Riksbank's API for the exchange rates at the different dates. - Enjoy a clear list with SEK-converted values, rounded to full kronor.
- Cross-check the USD amounts with the 1042-S form from E*Trade. (
getCashTransactions.json
only looks back 365 days.)
Script: Scripts/EtradeK4.ps1
Usage:
- Log into E*Trade.
- Go to Stock Plan -> Tax Information -> Cost Basis.
- Open the web browser inspector (e.g., press
F12
in Google Chrome). - Use the
Network
tab to record the outgoing HTTP requests. - Optionally click the
Clear
button to get rid of the clutter. - Select the tax year and click
Apply
. AgainsLosses.json
should appear in theNetwork
view. - Click
gainsLosses.json
. The view will change, switch to theResponse
tab. Click the toggle to displayRaw
data, if there is one. - Copy-paste the contents of that tab, save it as
gainsLosses.json
. - Run the
./EtradeK4.ps1
script in the directory containinggainsLosses.json
. This can take a while since it asks Riksbank's API for the exchange rates at the different dates. - Enjoy a clear table with SEK-converted values, rounded to full kronor, and ready to be copied into the K4 form.
Script: Scripts/SchwabK4+Dividends.ps1
Usage:
- Log into Schwab.
- Go to Transaction History.
- Open the web browser inspector (e.g., press
F12
in Firefox). - Use the
Network
tab to record the outgoing HTTP requests. - Optionally click the
Clear
button to get rid of the clutter. - Select the Date range (Previous Year, most likely) and click
Search
. Atransactions
item should appear in theNetwork
view. - Click
transactions
. The view will chang 6438 e, switch to theResponse
tab. Click the toggle to displayRaw
data, if there is one. - Copy-paste the contents of that tab, save it as
transactions.json
. - Run the
./SchwabK4+Dividends.ps1
script in the directory containingtransactions.json
. This can take a while since it asks Riksbank's API for the exchange rates at the different dates. - Enjoy a clear table with SEK-converted values, rounded to full kronor, and ready to be copied into the K4 form, and/or field 7.2 of the declaration (Ränteinkomster, utdelningar m.m.).