TradingView OpenCode Agent
Allows writing, compiling, and managing Pine Script indicators and strategies, including error checking and adding oscillators.
Provides tools for chart analysis, reading indicators and SMC levels, managing alerts, capturing screenshots, multi-symbol scanning, and replay mode for trading practice through the TradingView Desktop application.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TradingView OpenCode Agent Analyze my ES1! chart on the 15-minute timeframe"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TradingView OpenCode Agent 🤖
Conecta tu TradingView Desktop con opencode.ai para análisis de charts con IA.
Este proyecto está INSPIRADO en tradingview-mcp de tradesdontlie. No es un fork directo — es una reimplementación con código 100% original y documentación en español/inglés.
✨ Características
Característica | Descripción |
📊 Análisis de Chart | Lee indicadores, niveles, tablas de Pine, y estado del gráfico |
📈 Indicadores | SMC, ICT, RSI, MACD, Bollinger Bands, VWAP, EMA, SMA, Stochastic, y más... |
🎯 Niveles SMC | Detecta CHoCH, BOS, SFP, Fair Price Zones, zonas de liquidez |
⏪ Replay Mode | Practica trading en datos históricos con control de barras |
📋 Reports | Genera reportes de estrategia con métricas de rendimiento |
🔍 Multi-Symbol | Escanea múltiples instrumentos en batch |
📸 Screenshots | Captura charts automáticamente para análisis |
🔔 Alertas | Crea y gestiona alertas de precio |
Related MCP server: TradingView MCP Bridge
🚀 Instalación Rápida
# 1. Clonar el repo
git clone https://github.com/jadatorin/tradingview-opencode-agent.git
cd tradingview-opencode-agent
# 2. Instalar dependencias
npm install
# 3. Configurar opencode.ai
# Agregar a tu ~/.config/opencode/mcp.json:
{
"mcp": {
"tradingview": {
"command": ["node", "C:/Users/TU_USUARIO/proyects/tradingview-opencode-agent/src/index.js"],
"type": "local"
}
}
}
# 4. Iniciar TradingView con CDP (Chrome + sesión persistente)
.\launchers\launch_tv_cdp.ps1
# Alternativa: si tenés la versión Desktop (MSIX/Store):
.\launchers\launch_tv_msix.ps1
# ⚠️ MSIX no soporta CDP — las tools MCP no conectarán
# 5. Verificar conexión
npm run test📋 Requisitos
Requisito | Versión Mínima |
Node.js | 18+ |
TradingView Desktop | Windows/Mac/Linux (cualquiera) |
opencode.ai | Cliente MCP-compatible |
Suscripción TradingView | Para datos en tiempo real (opcional) |
🎯 Uso Rápido
Análisis de Chart
"Analiza mi chart de ES1! en 15 minutos"
"Qué indicadores tengo activos?"
"Cuáles son los niveles de soporte y resistencia?"
"Dame un screenshot del gráfico actual"Pine Script
"Escribe un indicador de VWAP con bandas"
"Compila mi script de estrategia"
"Hay errores de compilación? cuales?"
"Agrega un oscilador estocástico"Replay Trading
"Inicia replay en SPY desde marzo 2025"
"Avanza 5 velas hacia adelante"
"Toma una posición larga en el último swing"
"Cierra la posición y muéstrame el P&L"Multi-Symbol Scan
"Escanea ES, NQ, YM para oportunidades alcistas"
"Compara RSI en BTC, ETH y SOL"
"Múltiples screenshots de mi watchlist"📁 Estructura del Proyecto
tradingview-opencode-agent/
├── src/ # Servidor MCP
│ ├── index.js # Entry point
│ ├── server.js # Implementación del servidor
│ ├── config.js # Configuración centralizada
│ └── utils/
│ ├── cdp-client.js # Cliente Chrome DevTools Protocol
│ └── trading-helpers.js # Helpers de TradingView
│
├── opencode-skills/ # Skills para opencode.ai
│ ├── SKILL.md # Dispatcher principal
│ ├── chart-analysis/ # Análisis técnico
│ ├── pine-develop/ # Desarrollo Pine Script
│ ├── replay-practice/ # Modo replay
│ ├── multi-symbol-scan/ # Escaneo multi-símbolo
│ ├── strategy-report/ # Reportes de estrategia
│ └── docs/ # Docs de referencia
│
├── launchers/ # Scripts de lanzamiento
│ ├── launch_tv_cdp.ps1 # [RECOMENDADO] Chrome + CDP + sesión persistente
│ ├── launch_tv.ps1 # Windows universal (detecta cualquier versión)
│ ├── launch_tv.sh # Linux/macOS
│ ├── launch_tv_desktop.ps1 # Desktop installer
│ ├── launch_tv_msix.ps1 # Microsoft Store (sin CDP)
│ ├── start_all.ps1 # Lanza CDP + MCP server en un solo comando
│ └── start_mcp.ps1 # Solo MCP server (cuando TV ya está abierto)
│
├── docs/ # Documentación principal
└── package.json # Dependencias Node.js🔧 Configuración
Variables de Entorno (opcional)
# Puerto de debug de Chrome (default: 9222)
CDP_PORT=9222
# Host de Chrome (default: localhost)
CDP_HOST=localhost
# Directorio para screenshots (default: ./screenshots)
SCREENSHOT_DIR=./screenshots
# Timeout de operaciones (default: 30000ms)
TIMEOUT_MS=30000Configuración de MCP
OpenCode (formato correcto)
{
"mcp": {
"tradingview": {
"command": ["node", "C:/Users/TU_USUARIO/proyects/tradingview-opencode-agent/src/index.js"],
"type": "local"
}
}
}Claude Desktop / Cursor
{
"mcpServers": {
"tradingview": {
"command": "node",
"args": ["C:/Users/TU_USUARIO/proyects/tradingview-opencode-agent/src/index.js"]
}
}
}Tip: Para rutas relativas usa
./src/index.jssi el config está en la raíz del proyecto.
🛡️ Seguridad
Aspecto | Estado |
✅ Código 100% original | Auditado, sin dependencias externas |
✅ Sin conexiones a servidores | Todo corre localmente |
✅ Sin recopilación de datos | No hay telemetry ni tracking |
✅ Chrome DevTools Protocol | Conexión local a tu app |
📚 Documentación Detallada
Documento | Descripción |
Guía paso a paso de instalación | |
Configuración detallada de MCP | |
Arquitectura técnica del proyecto | |
Problemas comunes y soluciones | |
Scripts de lanzamiento | |
Skills de opencode.ai |
🤝 Contribuir
# 1. Fork el repo
# 2. Crea una rama
git checkout -b feature/nueva-feature
# 3. Commit con convencionales
git commit -m 'feat: nueva feature awesome'
# 4. Push
git push origin feature/nueva-feature
# 5. Abre un Pull Request📜 Licencia
MIT License — ver LICENSE
👥 Autores
jadatorin (aka bitorin)
GitHub: @jadatorin
TradingView: bitorin
Inspirado por: tradesdontlie/tradingview-mcp
⭐ Si te resultó útil, dale una estrella al repo!
Available Tools
22 toolsalert_createC
Create a new alert
Inputs: condition (required), symbol, message, interval.
alert_deleteB
Delete an alert by ID
Inputs: id (required).
alert_listB
List all alerts
Inputs: no named parameters.
batch_runC
Execute operations across multiple symbols
Inputs: symbols (required), operation (required), count, timeframe.
capture_screenshotC
Capture chart screenshot
Inputs: filename, full_page.
chart_get_stateB
Get current chart state: symbol, timeframe, indicators
Inputs: no named parameters.
data_get_ohlcvB
Get historical OHLCV bars
Inputs: symbol (required), to, from, count, +1 more.
data_get_pine_labelsB
Get drawn labels from Pine scripts
Inputs: all.
data_get_pine_linesB
Get drawn lines from Pine scripts
Inputs: all.
data_get_pine_tablesB
Get table data from Pine scripts
Inputs: table_id.
data_get_study_valuesB
Get values from indicators/studies on chart
Inputs: symbols, study_id.
draw_clearB
Clear all drawings or drawings of a type
Inputs: type.
draw_listB
List all drawn objects on chart
Inputs: type.
draw_removeB
Remove a drawn object by ID
Inputs: id (required).
draw_shapeC
Draw a shape on the chart
Inputs: type (required), points (required), text, style.
quote_getA
Get current quote (price, OHLC) for a symbol
Inputs: symbol (required).
replay_startC
Start replay mode
Inputs: to, from.
replay_statusB
Get current replay status
Inputs: no named parameters.
replay_stepA
Advance replay by one bar
Inputs: no named parameters.
replay_stopA
Stop replay mode
Inputs: no named parameters.
tv_health_checkA
Verify CDP connection to TradingView/Chrome
Inputs: no named parameters.
tv_launchC
Detect and launch TradingView application
Inputs: url, browser.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Each tool has a clearly distinct purpose, targeting specific actions like data retrieval, drawing, or replay. Overlaps are minimal and descriptions clarify differences, e.g., quote_get vs data_get_ohlcv or study vs pine objects.
Most tools follow a domain_verb_object pattern (e.g., chart_get_state, alert_create), but batch_run and tv_launch deviate slightly in structure. Overall consistent within each subdomain.
With 22 tools, the set is on the heavier side, bordering on excessive for a charting assistant. While each tool serves a distinct function, the overall count could be streamlined without losing core capabilities.
The tool set covers major areas like data, drawings, alerts, and replay, but lacks essential chart modification tools (e.g., set symbol/timeframe, add/remove indicators). This limits the agent's ability to perform full chart interactions.
Maintenance
Related MCP Connectors
Evidence-gated quant research for TradingView Pine Script strategies, run from your AI client.
Connect AI agents to Turbine Studio for strategies, backtests, research, and trading activity.
> TradingMCP puts a market analyst inside your AI assistant. Paste one URL into Claude, ChatGPT, Cursor, VS Code or any MCP client and ask in plain language: screen for breakouts, run a multi-timeframe analysis, backtest a strategy with walk-forward validation, scan for smart-money and volume signals, or get a one-prompt morning market brief. In clients that support MCP Apps, price charts and the Markets panel are drawn right in the chat. > 40+ tools covering crypto (real-time), stocks, ETFs, FX, futures and commodities across major global exchanges. > Hosted, nothing to install: Pro $9/month (2,500 tool calls) or Pro+ $29/month (10,000). Paid upfront with a 14-day money-back guarantee; your API key arrives right after checkout. > Built on the open-source tradingview-mcp core (MIT, ~5k GitHub stars): self-host it free, or use the hosted version with zero ops. > For research and education, not financial advice. Not affiliated with TradingView
AI-powered Pine Script v6 strategy generator built for prop-firm futures traders.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceConnects AI assistants to TradingView Desktop via Chrome DevTools Protocol for AI-assisted chart analysis, Pine Script development, and workflow automation.88 npm3-
- FlicenseNot gradedqualityDmaintenancePersonal AI assistant for your TradingView Desktop charts. Connects AI to your locally running TradingView app via Chrome DevTools Protocol for AI-assisted chart analysis, Pine Script development, and workflow automation.88 npm-
- FlicenseNot gradedqualityCmaintenanceConnects AI assistants to TradingView Desktop for chart analysis, Pine Script development, and workflow automation via Chrome DevTools Protocol.88 npm-
- FlicenseNot gradedqualityCmaintenanceConnects AI assistants to TradingView Desktop for chart analysis, Pine Script development, and automation via Chrome DevTools Protocol.88 npm-