Skill2.8k estrellas del repoactualizado 5d ago
tradingview-reader
The tradingview-reader skill extracts real-time quotes, options chains, and chart state from TradingView's desktop macOS application via Chrome DevTools Protocol and a custom opencli plugin. Use this skill when you need to analyze market data, check implied volatility and Greeks, or capture current chart configurations without placing trades or modifying watchlists. Requires TradingView.app installed and logged in locally.
Instalar en Claude Code
Copiargit clone --depth 1 https://github.com/himself65/finance-skills /tmp/tradingview-reader && cp -r /tmp/tradingview-reader/plugins/data-providers/skills/tradingview-reader ~/.claude/skills/tradingview-readerDespués abre una sesión nueva de Claude Code; el skill carga automáticamente.
Definición
SKILL.md
# TradingView Reader (Read-Only)
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).
**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.
**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.
**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.
---
## Step 1: Ensure opencli + Plugin Are Installed and Ready
**Current environment status:**
```
!`(command -v opencli && opencli tradingview status 2>&1 | head -5 && echo "READY" || echo "SETUP_NEEDED") 2>/dev/null || echo "NOT_INSTALLED"`
```
If the status above shows `READY`, skip to Step 2. Otherwise:
### NOT_INSTALLED — Install opencli
```bash
npm install -g @jackwener/opencli
```
Requires Node.js >= 21 (or Bun >= 1.0).
### SETUP_NEEDED — Install the TradingView plugin and launch with CDP
The TradingView adapter is **not** built into opencli — it's a separate plugin:
```bash
# Install the plugin
opencli plugin install github:himself65/finance-skills/tradingview
# Relaunch TradingView.app with CDP enabled (one-time per session)
opencli tradingview launch
```
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.
### Common setup issues
| Symptom | Fix |
|---|---|
| `opencli: command not found` | `npm install -g @jackwener/opencli` (Node ≥ 22 for built-in WebSocket) |
| `Unknown command: tradingview` | `opencli plugin install github:himself65/finance-skills/tradingview` |
| `Cannot reach CDP at http://127.0.0.1:9222` | App not launched with debug port — run `opencli tradingview launch` |
| `No tradingview.com cookies found` | App is open but logged out — log in inside the desktop app |
| `No TradingView tab found` | Open any chart or symbol page in TradingView, then retry |
| Empty chain / 0 contracts | Subscription tier on the logged-in account doesn't include options for this symbol |
---
## Step 2: Identify What the User Needs
### Setup / chart inspection
| User Request | Command | Key Flags |
|---|---|---|
| Setup / connection check | `opencli tradingview status` | — |
| Relaunch app with CDP | `opencli tradingview launch` | `--port 9222` |
| What's on the chart | `opencli tradingview chart-state` | `--tab <id>` |
| Screenshot a chart | `opencli tradingview screenshot --output ~/charts/nvda.png` | `--tab <id>` |
### Quotes + options
| User Request | Command | Key Flags |
|---|---|---|
| Spot quote | `opencli tradingview quote --ticker X` | `--exchange NASDAQ` |
| Options chain (full) | `opencli tradingview options-chain --ticker X` | `--exchange` |
| Options chain (one expiry, ATM band) | `opencli tradingview options-chain --ticker X --expiry YYYY-MM-DD` | `--type call\|put`, `--strikes-around-spot N` |
| List expiries | `opencli tradingview options-expiries --ticker X` | — |
### Screener
| User Request | Command | Key Flags |
|---|---|---|
| Generic screener (stocks/crypto/forex/futures/bonds) | `opencli tradingview screener --market america --columns ...` | `--filter <json>`, `--sort field:desc`, `--limit N`, `--label-product` |
| US stocks with RSI < 30, sorted by volume | `opencli tradingview screener --market america --columns "name,close,RSI\|60,volume" --filter '[{"left":"RSI\|60","operation":"less","right":30}]' --sort volume:desc` | — |
| Top crypto by market cap | `opencli tradingview screener --market coin --columns "name,close,change,market_cap_calc" --sort market_cap_calc:desc --limit 50` | — |
| Symbol search / autocomplete | `opencli tradingview search --query "nvidia"` | `--type stock\|funds\|crypto\|...`, `--exchange`, `--country` |
### News
| User Request | Command | Key Flags |
|---|---|---|
| Global news headlines | `opencli tradingview news --limit 25` | `--category`, `--area`, `--section`, `--provider` |
| News for a specific ticker | `opencli tradingview news --symbol NASDAQ:AAPL` | `--limit`, `--section analysis\|press_release\|...` |
| Full story by id | `opencli tradingview news --id <story-id>` | `--lang en` |
### Watchlists + alerts
| User Request | Command | Key Flags |
|---|---|---|
| List all watchlists | `opencli tradingview watchlists` | — |
| Symbols in one watchlist | `opencli tradingview watchlists --id <wl-id>` | — |
| Colored-flag list (red/orange/yellow/green/blue/purple) | `opencli tradingview watchlists --color red` | — |
| List all alerts | `opencli tradingview alerts --type list` | — |
| Active alerts | `opencli tradingview alerts --type active` | — |
| Recently triggered alerts | `opencli tradingview alerts --type triggered` | — |
| Alerts that fired while offline | `opencli tradingview alerts --type offline` | — |
| Full alert log | `opencli tradingview alerts --type log` | — |
---
## Step 3: Execute the Command
### General pattern
```bash
# Use -f json or -f yaml for structured output
opencli t