Commit Graph

6 Commits

Author SHA1 Message Date
ojy
46574c4f51 Standardize sidebar across all 7 pages
Every page now uses the same brand logo (candle chart icon) and the same
seven nav items in the same order with identical tabler-style icons:
Dashboard · Options Chain · Vol Surface · Strategy P/L · Positions ·
Tracker · Settings. Only the active item differs per page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 07:17:40 +00:00
ojy
65cb6cc5f2 Tracker watchlist: summary cards + auto-load first symbol
Each watched symbol now appears as a small card showing live spot, ATM IV
(color-coded by level), and RR25 — fetched from /api/analytics. Click a
card to load that symbol's full IV/RR/Fly history charts; the active card
gets a blue border.

On page open: if there's a watchlist but no history loaded yet, auto-open
the first watched symbol so the page isn't empty. Refresh button re-pulls
all watchlist metrics. Empty state hints at adding symbols from the
Strategy page's "Save to Tracker" button.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 07:14:06 +00:00
ojy
9de7f14573 Split Positions from Tracker; add Settings (commission)
Tracker is for symbol price/IV history, not positions. The "Save to
Tracker" button now adds the symbol to a watchlist (localStorage); the
Tracker page shows the watchlist as clickable chips.

New "Enter Position" button on the Strategy page posts the active legs
to /api/orders, then opens the new Positions page.

New Positions page (positions.html): lists entered positions with live
mid value, round-trip commission, gross & net P/L (Net = Gross − round-
trip commission), per-symbol filter, summary totals, close/reopen and
remove actions.

New Settings page (settings.html) configures the commission used on
Positions. Defaults to Interactive Brokers Fixed / IBKR Lite: $0.65
per contract, $1.00 minimum per order
(https://www.interactivebrokers.com/en/pricing/commissions-options.php).
Per-leg vs per-order toggle for complex orders.

Sidebar nav now: Dashboard · Options Chain · Vol Surface · Strategy P/L
· Positions · Tracker · Settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 07:04:52 +00:00
ojy
c1520d7962 Tracked orders — persist strategy positions in SQLite
Backend:
- New orders table (symbol, name, legs_json, entry_cost, created_at,
  closed_at, status, note) sharing the snapshots.db
- Endpoints:
  POST   /api/orders          save a position
  GET    /api/orders?symbol=  list (most recent first)
  GET    /api/orders/:id      single
  PATCH  /api/orders/:id      { status:'open'|'closed', note? }
  DELETE /api/orders/:id      remove

Strategy page:
- "Save to Tracker" button posts the currently-active legs (with name,
  net cost, side, qty, entry, IV, lock) as an order

Tracker page:
- New "Tracked Orders" section above the IV history charts: lists each
  saved position for the current symbol with strategy name, leg summary,
  entered cost, current value, P/L $ and %, opened date, status, and
  Close/Reopen + Remove actions. Live P/L uses /api/chain mids for each
  unique leg expiry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 06:54:40 +00:00
ojy
3109df842d Add strategy P/L analyzer + view-state persistence
- New strategy.html: thinkorswim-style P/L diagram (expiration + T+N curves
  via Black-Scholes, days-to-expiry slider, net debit/credit, max profit/loss
  with unbounded detection, breakevens, net Greeks, auto-detected strategy name)
- chain.html: per-row Buy/Sell buttons add legs to a localStorage basket;
  basket badge in toolbar; auto-scroll to ATM row on load
- Persist per-page view state (symbol, expiry, loaded data, charts) across
  navigation via viewstate-store.js for chain/surface/tracker/dashboard
- New assets: blackscholes.js (frontend BS port), strategy-store.js, viewstate-store.js
- Strategy P/L nav link added to all sidebars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 04:01:57 +00:00
ojy
d08c2230a8 Initial commit — options pricing dashboard
Full-stack options analytics app: IV surface, Greeks, skew metrics,
vol term structure. Yahoo Finance data with Black-Scholes IV computation
and historical vol fallback for after-hours data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 03:22:23 +00:00