$npx -y skills add himself65/finance-skills --skill tradingview-readerRead TradingView desktop app for market data, news, alerts, watchlists, and screener results using opencli (read-only). Use this skill whenever the user wants quotes, options chains, options expiries, screener results across stocks/crypto/forex/futures/bonds, gainers/losers/mover
| 1 | # TradingView Reader (Read-Only) |
| 2 | |
| 3 | Reads TradingView's desktop macOS app for quotes, options chains, and chart state via [opencli](https://github.com/jackwener/opencli) and a CDP attach to the running TradingView.app process. Powered by the `tradingview` plugin in this repo's [`opencli-plugins/tradingview`](https://github.com/himself65/finance-skills/tree/main/opencli-plugins/tradingview) tree (a separate plugin from opencli's built-in adapters, installed via opencli's monorepo subpath syntax). |
| 4 | |
| 5 | **This skill is read-only.** Designed for analysis: pulling options chains, checking IV/greeks, capturing chart state. It does NOT place trades, post ideas, modify watchlists, or change chart layouts. |
| 6 | |
| 7 | **Important**: Unlike browser-based opencli readers (twitter, linkedin), this one talks directly to a running TradingView desktop app over Chrome DevTools Protocol. The user must (a) have `TradingView.app` installed, and (b) be logged in inside that app. The plugin handles relaunching with the debug port. |
| 8 | |
| 9 | **How it works**: data commands harvest session cookies via CDP `Storage.getCookies`, then fire HTTP requests from Node directly. Page-context fetch is blocked by browser CORS preflight even from TradingView's own pages — the desktop app uses Electron's main process (Node network stack) to bypass this, and we replicate that path. No Browser Bridge extension required, no `apps.yaml` registration needed. |
| 10 | |
| 11 | --- |
| 12 | |
| 13 | ## Step 1: Ensure opencli + Plugin Are Installed and Ready |
| 14 | |
| 15 | **Current environment status:** |
| 16 | |
| 17 | ``` |
| 18 | !`(command -v opencli && opencli tradingview status 2>&1 | head -5 && echo "READY" || echo "SETUP_NEEDED") 2>/dev/null || echo "NOT_INSTALLED"` |
| 19 | ``` |
| 20 | |
| 21 | If the status above shows `READY`, skip to Step 2. Otherwise: |
| 22 | |
| 23 | ### NOT_INSTALLED — Install opencli |
| 24 | |
| 25 | ```bash |
| 26 | npm install -g @jackwener/opencli |
| 27 | ``` |
| 28 | |
| 29 | Requires Node.js >= 21 (or Bun >= 1.0). |
| 30 | |
| 31 | ### SETUP_NEEDED — Install the TradingView plugin and launch with CDP |
| 32 | |
| 33 | The TradingView adapter is **not** built into opencli — it's a separate plugin: |
| 34 | |
| 35 | ```bash |
| 36 | # Install the plugin |
| 37 | opencli plugin install github:himself65/finance-skills/tradingview |
| 38 | |
| 39 | # Relaunch TradingView.app with CDP enabled (one-time per session) |
| 40 | opencli tradingview launch |
| 41 | ``` |
| 42 | |
| 43 | The `launch` step quits the running TradingView and reopens it with `--remote-debugging-port=9222`. **Warn the user to save chart layouts first** if they have unsaved drawings. |
| 44 | |
| 45 | ### Common setup issues |
| 46 | |
| 47 | | Symptom | Fix | |
| 48 | |---|---| |
| 49 | | `opencli: command not found` | `npm install -g @jackwener/opencli` (Node ≥ 22 for built-in WebSocket) | |
| 50 | | `Unknown command: tradingview` | `opencli plugin install github:himself65/finance-skills/tradingview` | |
| 51 | | `Cannot reach CDP at http://127.0.0.1:9222` | App not launched with debug port — run `opencli tradingview launch` | |
| 52 | | `No tradingview.com cookies found` | App is open but logged out — log in inside the desktop app | |
| 53 | | `No TradingView tab found` | Open any chart or symbol page in TradingView, then retry | |
| 54 | | Empty chain / 0 contracts | Subscription tier on the logged-in account doesn't include options for this symbol | |
| 55 | |
| 56 | --- |
| 57 | |
| 58 | ## Step 2: Identify What the User Needs |
| 59 | |
| 60 | ### Setup / chart inspection |
| 61 | |
| 62 | | User Request | Command | Key Flags | |
| 63 | |---|---|---| |
| 64 | | Setup / connection check | `opencli tradingview status` | — | |
| 65 | | Relaunch app with CDP | `opencli tradingview launch` | `--port 9222` | |
| 66 | | What's on the chart | `opencli tradingview chart-state` | `--tab <id>` | |
| 67 | | Screenshot a chart | `opencli tradingview screenshot --output ~/charts/nvda.png` | `--tab <id>` | |
| 68 | |
| 69 | ### Quotes + options |
| 70 | |
| 71 | | User Request | Command | Key Flags | |
| 72 | |---|---|---| |
| 73 | | Spot quote | `opencli tradingview quote --ticker X` | `--exchange NASDAQ` | |
| 74 | | Options chain (full) | `opencli tradingview options-chain --ticker X` | `--exchange` | |
| 75 | | Options chain (one expiry, ATM band) | `opencli tradingview options-chain --ticker X --expiry YYYY-MM-DD` | `--type call\|put`, `--strikes-around-spot N` | |
| 76 | | List expiries | `o |