### Clone and Install Repository Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/SETUP_GUIDE.md Initial setup commands to download the project and install dependencies. ```bash git clone https://github.com/tradesdontlie/tradingview-mcp.git ~/tradingview-mcp cd ~/tradingview-mcp npm install ``` -------------------------------- ### Install and Run CLI Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md Instructions for installing the CLI globally or executing it directly via Node.js. ```bash # Install globally (optional) npm link # Or run directly node src/cli/index.js ``` -------------------------------- ### Install TradingView MCP Server Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md Clone the repository and install dependencies to prepare the server environment. ```bash git clone https://github.com/tradesdontlie/tradingview-mcp.git cd tradingview-mcp npm install ``` -------------------------------- ### CLI Quick Examples Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md Commonly used commands for checking status, managing symbols, and capturing data. ```bash tv status # check connection tv quote # current price tv symbol AAPL # change symbol tv ohlcv --summary # price summary tv screenshot -r chart # capture chart tv pine compile # compile Pine Script tv pane layout 2x2 # 4-chart grid tv pane symbol 1 ES1! # set pane symbol tv stream quote | jq '.close' # monitor price changes ``` -------------------------------- ### Install CLI Globally Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/SETUP_GUIDE.md Command to link the project globally for CLI access. ```bash cd ~/tradingview-mcp npm link ``` -------------------------------- ### Development environment commands Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/CONTRIBUTING.md Standard commands for installing dependencies, linting, running tests, and verifying the CDP connection. ```bash npm install npm run lint # eslint — the no-undef guard catches unfinished refactors npm run test:unit # offline unit tests (no TradingView needed) npm run test:e2e # requires TradingView running with CDP on port 9222 tv status # verify CDP connection (TradingView must be running) ``` -------------------------------- ### Available CLI Commands Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md A comprehensive list of command categories available in the tv CLI. ```bash tv status / launch / state / symbol / timeframe / type / info / search tv quote / ohlcv / values tv data lines/labels/tables/boxes/strategy/trades/equity/depth/indicator tv pine get/set/compile/analyze/check/save/new/open/list/errors/console tv draw shape/list/get/remove/clear tv alert list/create/delete tv watchlist get/add tv indicator add/remove/toggle/set/get tv layout list/switch tv pane list/layout/focus/symbol tv tab list/new/close/switch tv replay start/step/stop/status/autoplay/trade tv stream quote/bars/values/lines/labels/tables/all tv ui click/keyboard/hover/scroll/find/eval/type/panel/fullscreen/mouse tv screenshot / discover / ui-state / range / scroll ``` -------------------------------- ### Launch TradingView Desktop Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/SETUP_GUIDE.md Platform-specific commands to launch TradingView with remote debugging enabled. ```bash /Applications/TradingView.app/Contents/MacOS/TradingView --remote-debugging-port=9222 ``` ```bat scripts\launch_tv_debug.bat ``` ```powershell $pkg = (Get-AppxPackage TradingView.Desktop).InstallLocation Copy-Item "$pkg\*" "$env:LOCALAPPDATA\tradingview-mcp\TradingView" -Recurse -Force & "$env:LOCALAPPDATA\tradingview-mcp\TradingView\TradingView.exe" --remote-debugging-port=9222 ``` ```bash %LOCALAPPDATA%\TradingView\TradingView.exe --remote-debugging-port=9222 ``` ```bash /opt/TradingView/tradingview --remote-debugging-port=9222 # or: tradingview --remote-debugging-port=9222 ``` -------------------------------- ### Streaming Data Commands Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md Commands for monitoring real-time data from the local TradingView Desktop instance. ```bash tv stream quote # price tick monitoring tv stream bars # bar-by-bar updates tv stream values # indicator value monitoring tv stream lines --filter "NY Levels" # price level monitoring tv stream tables --filter Profiler # table data monitoring tv stream all # all panes at once (multi-symbol) ``` -------------------------------- ### Run Strategy Performance Comparison Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/skills/multi-symbol-scan/SKILL.md Use `batch_run` with action `get_strategy_results` to compare strategy performance across multiple symbols and timeframes. ```json symbols: ["ES1!", "NQ1!", "YM1!", "RTY1!"] timeframes: ["15"] action: "get_strategy_results" ``` -------------------------------- ### Configure MCP Server Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/SETUP_GUIDE.md JSON configuration structure to add the TradingView server to Claude Code. ```json { "mcpServers": { "tradingview": { "command": "node", "args": ["/src/server.js"] } } } ``` -------------------------------- ### Run Screenshot Comparison Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/skills/multi-symbol-scan/SKILL.md Use `batch_run` with action `screenshot` to generate screenshots for comparison across multiple symbols and timeframes. ```json symbols: ["AAPL", "MSFT", "GOOGL", "AMZN"] timeframes: ["D"] action: "screenshot" ``` -------------------------------- ### Run project tests Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md Executes the test suite. Ensure TradingView is running with the remote debugging port enabled before execution. ```bash # Requires TradingView running with --remote-debugging-port=9222 npm test ``` -------------------------------- ### Configure MCP Server Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md Add the server configuration to your Claude Code MCP settings file. ```json { "mcpServers": { "tradingview": { "command": "node", "args": ["/path/to/tradingview-mcp/src/server.js"] } } } ``` -------------------------------- ### Replay Mode Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/CLAUDE.md Tools for practicing trading using the TradingView replay feature. ```APIDOC ## Tool: replay_start ### Description Enters replay mode at a specified date. ## Tool: replay_trade ### Description Executes buy, sell, or close actions during replay mode. ``` -------------------------------- ### Verify Connection Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/SETUP_GUIDE.md Expected JSON response from the health check tool. ```json { "success": true, "cdp_connected": true, "chart_symbol": "...", "api_available": true } ``` -------------------------------- ### Push and Compile Pine Script Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/skills/pine-develop/SKILL.md This script injects your local Pine Script code into TradingView's editor, initiates a compilation, and reports any errors encountered. Ensure your code is saved to `scripts/current.pine` before running. ```bash node scripts/pine_push.js ``` -------------------------------- ### System Architecture Flow Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/CLAUDE.md Visual representation of the communication path between components. ```text Claude Code ←→ MCP Server (stdio) ←→ CDP (localhost:9222) ←→ TradingView Desktop (Electron) ``` -------------------------------- ### Enable Remote Debugging Port Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md Command-line flag required to enable the debug port in the Chromium-based TradingView application. ```bash --remote-debugging-port=9222 ``` -------------------------------- ### View Architecture Diagram Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md Visual representation of the communication flow between Claude Code, the MCP server, and the TradingView Desktop application. ```text Claude Code ←→ MCP Server (stdio) ←→ CDP (port 9222) ←→ TradingView Desktop (Electron) ``` -------------------------------- ### Replay Mode Tools Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md Tools for controlling the TradingView replay mode to backtest or review historical price action. ```APIDOC ## MCP Tools: Replay Mode - `replay_start`: Enter replay mode at a specific date. - `replay_step`: Advance one bar. - `replay_autoplay`: Auto-advance replay (set speed in ms). - `replay_trade`: Execute buy/sell/close positions. - `replay_status`: Check current position, P&L, and date. - `replay_stop`: Exit replay mode and return to realtime. ``` -------------------------------- ### Chart State and Data Retrieval Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/CLAUDE.md Tools for retrieving the current state of the chart, indicator values, and real-time price data. ```APIDOC ## Tool: chart_get_state ### Description Retrieves the current symbol, timeframe, chart type, and a list of all indicators with their entity IDs. ## Tool: data_get_study_values ### Description Retrieves current numeric values from all visible indicators (e.g., RSI, MACD, BBands, EMAs). ## Tool: quote_get ### Description Retrieves a real-time price snapshot including OHLC and volume for the current symbol. ``` -------------------------------- ### Chart Reading Tools Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/README.md Tools for retrieving chart state, indicator values, price quotes, and OHLCV data. ```APIDOC ## MCP Tools: Chart Reading - `chart_get_state`: Retrieve symbol, timeframe, and indicator names/IDs. - `data_get_study_values`: Read current values from indicators (RSI, MACD, BB, EMA). - `quote_get`: Get latest price, OHLC, and volume. - `data_get_ohlcv`: Get price bars (use `summary: true` for compact stats). ``` -------------------------------- ### Pine Graphics Data Path Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/CLAUDE.md Internal path for accessing Pine graphics primitives. ```text study._graphics._primitivesCollection.dwglines.get('lines').get(false)._primitivesDataById ``` -------------------------------- ### Pull Existing Pine Script Code Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/skills/pine-develop/SKILL.md Use this command to fetch the current Pine Script code from TradingView when modifying an existing script. The code is saved to `scripts/current.pine`. ```bash node scripts/pine_pull.js ``` -------------------------------- ### Pine Script Development Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/CLAUDE.md Tools for managing, compiling, and debugging Pine Script code within the editor. ```APIDOC ## Tool: pine_set_source ### Description Injects code into the editor. ## Tool: pine_smart_compile ### Description Compiles the script with auto-detection and error checking. ## Tool: pine_get_console ### Description Reads log.info() output from the script. ``` -------------------------------- ### Pine Script Element Extraction Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/CLAUDE.md Tools for extracting data from custom Pine Script drawings like lines, labels, tables, and boxes. ```APIDOC ## Tool: data_get_pine_lines ### Description Retrieves horizontal price levels drawn by indicators. ## Tool: data_get_pine_labels ### Description Retrieves text annotations with prices from the chart. ## Tool: data_get_pine_tables ### Description Retrieves table data formatted as rows. ## Tool: data_get_pine_boxes ### Description Retrieves price zones or ranges as high/low pairs. ``` -------------------------------- ### Chart Manipulation Source: https://github.com/tradesdontlie/tradingview-mcp/blob/main/CLAUDE.md Tools for modifying the chart view, symbols, timeframes, and indicators. ```APIDOC ## Tool: chart_set_symbol ### Description Switches the current ticker symbol. ## Tool: chart_set_timeframe ### Description Switches the chart resolution (e.g., '1', '5', 'D'). ## Tool: chart_manage_indicator ### Description Adds or removes studies by their full name. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.