Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ One way: Fidelity -> your Google Sheet -> the viewer. The viewer only asks for a
- Every 6 hours (no market hours or weekdays in the timing), the script also reads Fidelity's own daily account values (the data of its Summary balance chart): since each account opened the first time, then the last month. The Balance card draws them for the chosen accounts with periods from 1D to 3Y (the card shows the main ones, the big chart every step: 1D..3D, WTD, 1W..3W, MTD, 1M..11M, QTD, 1Q..3Q, YTD, 1Y..3Y); ⤢ grows the card into a big window, ✕, a click outside or Esc shrinks it back. The change shown is the balance change (deposits are in it), not a return
- Right after that it reads the transactions history of every account (the same read the Activity page makes): the first time month by month since the account's first daily value, then the last 10 days again. That read runs every 6 hours; with 👀 on it also reads yesterday and today every 10 minutes and writes the sheet only when something new came. A read missed because the Fidelity tab was closed runs when a Fidelity page opens next. The Income card shows the dividends and interest really received this year, quarter and month next to the plan (received plus what still comes at today's holdings) with a progress bar; until the history is read it shows --
- After the transactions, every 6 hours, Fidelity's tax info of every account (the read its Tax Info YTD page makes): which dividend payments are qualified and which are not. The current year is read with every read (its numbers are preliminary until the 1099), an earlier year once. The mark is put on the dividend transaction of the same account, day and CUSIP and written to the `qualified` column of `fidelity_transactions`. The first time after an update to 0.1.42 or later the transactions of every account are read once more from their first day, to get each security's CUSIP
- Along with those reads (every hour, and after each read of Positions, never twice within 5 minutes), Fidelity's Tax Info YTD summary of the taxable accounts (the read its Tax Info YTD page makes; Roth and other retirement accounts get no 1099): every box of the year's 1099-DIV, 1099-INT, 1099-MISC and 1099-OID so far, the margin interest paid and the realized short and long term gain or loss, written to `fidelity_tax_summary`. From January 1 to April 15 the year before is read too. A box with a text instead of a number (Various, N/A) is left out, a zero is kept
- Then, once a day, the beta of every holding, all read only from Fidelity and measured against the S&P 500 the way Fidelity defines beta: stocks from its stock screener (5Y beta, else 3Y, else 1Y); ETFs, mutual funds and everything else computed by the script from Fidelity's own price history: total monthly returns against SPY over the last 36 months (at least 12), daily over the last year when the history is shorter. Only a fund too young for both gets the ETF screener's 3Y beta, which is Morningstar's and may be measured against the fund's category index rather than the S&P 500 (marked ETFs 3Y). Cash is 0. The Accounts card shows each account's beta on the right as 1.17β: the average of its positions' betas weighted by their value. When some positions have no beta (bonds and CDs by CUSIP, options) the share of the value that has one shows under it in grey, for example 62%. A click on the beta opens the breakdown: every position with its value, weight, beta, source, date and contribution (the contributions add up to the account's beta), the ones without a beta last
- The ADP 401k (since 0.1.45): on a mykplan.adp.com page you are logged in to, the script reads the Transaction History month by month (a query form, read only; about 2 minutes the first time, then the last two months at most once an hour, ⬇ on its panel reads at once) and writes every row to the `adp_mykplan_transactions` tab of the same spreadsheet.
- The script's panel on Fidelity and mykplan (since 0.1.52): one line with its name and the buttons 👀 (a slowly blinking blue dot while watching, the same switch as in the viewer; on mykplan an open tab reads the history again every hour; switched on in the viewer it opens Fidelity, and the script opens mykplan in a background tab when none is open), {} downloads the read data as JSON, 🔔 notifications. It opens minimized to a round icon; a click on it, or ⚙️ Settings -> User preferences in the viewer, opens it for every page and tab, and a question that waits (a spreadsheet to allow) shows "!" on the icon. A reload of the viewer asks an open mykplan tab to read the new days (at most every 10 minutes); if its session ended, mykplan opens again, signs in with the saved login and reads on. A settings export carries 👀, 🔔 and the panel switch, an import hands them back to the script
Expand Down Expand Up @@ -70,7 +71,8 @@ Sheet tabs:
| `adp_mykplan_balances_monthly` | the 401k balance of each fund at the end of every month read and on the last price day: date, fund, quantity, price, balance | rewritten after each read on mykplan |
| `fidelity_transactions_synced` | how far each account's transactions were read | rewritten with it |
| `fidelity_betas` | the beta of each held symbol, its source and months behind it | rewritten after its daily run |
| `fidelity_updates` | when each data set (summary, positions, transactions, betas) was last written | updated after every write |
| `fidelity_tax_summary` | Fidelity's Tax Info YTD summary: account, tax year, form, box, amount, as of; the gains as form `gain-loss`, box `short-term` or `long-term` | rewritten after each read |
| `fidelity_updates` | when each data set (summary, positions, transactions, betas, performance, taxes, adp) was last written | updated after every write |

One thing has one name in every tab, the names of `fidelity_positions_all`: `account_number`, `account_name`, `symbol_name`, `symbol_description`, `quantity`, `week_52_low` and so on, all in snake_case. A tab written under earlier names gets its header renamed in place on the next write, the rows stay

Expand All @@ -80,7 +82,7 @@ Everything this app relies on at Fidelity is listed in `src/shared/contract.ts`:

## Safety

- Read only: the script never trades, transfers or submits anything on Fidelity; besides the pages it runs on it asks only Fidelity's daily values, transactions, screeners and price history, each through a fixed list of addresses; the only form it fills is the login, with your saved login, only on a page with exactly one password field and a username, at most once per 30 minutes, and it stops for good when the password is refused. Syncs asked from the viewer are taken at least 10 seconds apart
- Read only: the script never trades, transfers or submits anything on Fidelity; besides the pages it runs on it asks only Fidelity's daily values, transactions, tax info, investment results, screeners and price history, each through a fixed list of addresses; the only form it fills is the login, with your saved login, only on a page with exactly one password field and a username, at most once per 30 minutes, and it stops for good when the password is refused. Syncs asked from the viewer are taken at least 10 seconds apart
- Your data goes from your browser to your Google Sheet and nowhere else: other pages on daggerok.github.io share the viewer's storage, so the script keeps the allowed spreadsheet in its own Tampermonkey storage and asks on the Fidelity panel before writing to any other one (Full reset in the viewer does not change that). The repo holds no account data: tests use made-up numbers

## Develop
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "accounts",
"version": "0.1.88",
"version": "0.1.89",
"private": true,
"description": "Own viewer of your accounts (Fidelity first): a Tampermonkey script reads your positions (read only) into your Google Sheet",
"source": "src/viewer/index.html",
Expand Down
Loading