Complete pipeline from hourly scanner → signal review → trade entry → copy execution → position exit. Includes all four automated flowcharts, every API endpoint, and the full launchd schedule.
logs/dip_scan.logRunAtLoad: falsecopy_rh_orders loads that set and skips any matching order ID, so platform trades are never double-copied.
A separate rh_copy_seen.json prevents re-processing across hourly runs.
| Method | Path | Description | Used by |
|---|---|---|---|
| GET | /api/prices?symbols=… | Live last prices via yfinance for comma-separated symbols, including pre/post-market | Live Signals, Past Signals, Performance pages |
| GET | /api/confirmed?symbols=… | H Breakout status — last complete 1HR candle closed above prior high | Live Signals, Past Signals pages |
| GET | /api/account | Admin Robinhood account — equity, buying power, margin, day P&L | Robinhood page account strip |
| GET | /api/alpaca/account | First/test client's Alpaca account — equity, cash, buying power, margin | Alpaca page account strip |
| GET | /api/alpaca/positions | First/test client's Alpaca positions — used to verify copy trades are landing | Alpaca page (read-only monitor) |
| GET | /api/rh/positions | Admin's Robinhood positions with live quotes | Robinhood page open positions panel |
| GET | /api/refresh | Triggers sync_perf.py — syncs RH positions → perf_trades.json | Robinhood page Sync button |
| GET | /api/customers | Load all customers from data/customers.json | Customers page |
| GET | /api/copy_log | Full copy trade log — all buy/close mirror records | Customers page copy log |
| GET | /api/copy_rh_orders | Manually trigger copy_rh_orders.run() — detect & mirror direct RH trades | Robinhood page "Copy RH Trades" button |
| GET | /api/customer_account?id=… | Load a single customer's broker account data (equity, positions) | Customers page per-customer panel |
| GET | /api/client/resolve?token=… | Resolve a client's personal access token to {customer_id, name, joined} — no broker data | Client portal login (auth.js requireClient) |
| GET | /api/client/activity?id=… | That one customer's copy_log entries only — never the full multi-customer log | client/account.html Recent Activity |
| POST | /api/buy | Limit buy on admin's Robinhood + copy to all active customers | Buy modal (Live Signals / Robinhood page) |
| POST | /api/close | Market sell on admin's Robinhood + copy_close to all customers · updates perf_trades.json | Close button on Robinhood page positions panel |
| POST | /api/onboard | Create new customer record from onboarding form | landing.html onboarding flow |
| POST | /api/customers | Update existing customer — status, capital, credentials | Customers page edit modal |
| POST | /api/admin/login | Verify admin password → sets signed, HttpOnly session cookie | login.html |
| POST | /api/logout | Clears the session cookie | Admin nav logout |