{
  "markdown": "# TradingView Quantitative Investment Analysis Skill\n\n[English](README.md) | [简体中文](README.zh.md)\n\n[![Install with skills](https://img.shields.io/badge/install-skills-blue)](https://skills.sh/hypier/tradingview-quantitative-skills/tradingview-quantitative)\n[![GitHub](https://img.shields.io/github/stars/hypier/tradingview-quantitative-skills?style=social)](https://github.com/hypier/tradingview-quantitative-skills)\n\nProfessional quantitative investment analysis system based on TradingView data providing intelligent stock screening, technical pattern recognition, market review, risk management, and event-driven analysis.\n\n## Installation\n\nInstall this skill with one command:\n\n```bash\nnpx skills add hypier/tradingview-quantitative-skills\n```\n\n## Features\n\n- ✅ **Smart Stock Screening** - Multi-factor comprehensive scoring, dual filtering of technical + fundamental aspects\n- 📊 **Technical Pattern Recognition** - Automatically identify classic patterns, provide confidence assessment and trading strategies\n- 📈 **Market Review** - Track hot sectors, capital flows, discover investment opportunities\n- 🛡️ **Risk Management** - Position suggestions, stop-loss/take-profit, volatility analysis\n- 📰 **Event-Driven Analysis** - Track earnings, policies, news, analyze market impact\n- 🔍 **Deep Individual Stock Analysis** - Multi-timeframe technical analysis + fundamentals + news comprehensive evaluation\n- 💰 **Fundamental Screening** - High dividend, low valuation, profitability screening\n- 🔄 **Sector Rotation** - Identify strong sectors and rotation trends\n- 🧾 **Fundamental Data Deep Dive** - Company profile, financial statements, dividends, analyst recommendations\n- 🎯 **Advanced Screener Support** - Custom preset fields and filter-operator driven scans\n- 📉 **Standard OHLCV** - Real Japanese candles for returns, stops, and backtests (`tradingview_get_ohlcv`)\n- 📅 **Chart Events** - Earnings, dividend, and split markers (`tradingview_get_price_events`)\n- 🌍 **Macro Dashboard** - World economy indicators, economic calendar, and macro news in one flow\n- 💡 **Community Sentiment** - TradingView hot ideas, symbol minds, and crowd narrative tracking\n\n## Quick Start\n\n### 1. Configure MCP Server\n\nAdd the hosted TradingView MCP server to Cursor, VS Code, or Claude Desktop. The hosted server exposes 25 `tradingview_*` tools.\n\n**Configuration file paths**:\n- **Cursor**: `~/.cursor/mcp.json`\n- **Claude Desktop (macOS)**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- **VS Code**: MCP settings / server config JSON\n\n> **📖 Security Notice**: Please read [SECURITY.md](SECURITY.md) for important information about API key management and data privacy.\n\n#### Method 1: Console OAuth (Recommended)\n\nAdd the hosted URL. The first connection opens Console in the browser. Sign in and allow access. No JWT in the config file.\n\n```json\n{\n  \"mcpServers\": {\n    \"tradingview\": {\n      \"type\": \"http\",\n      \"url\": \"https://mcp.tradingviewapi.com/mcp\"\n    }\n  }\n}\n```\n\nOlder clients may use `\"type\": \"streamable-http\"` instead of `\"http\"`. The URL is the same.\n\n**Configuration Steps**:\n1. Visit https://console.tvapis.com/start and create an account\n2. Use a plan that includes MCP (Basic for testing, Ultra or Mega for production; Pro does not include MCP)\n3. Paste the config above\n4. Start the server in the client and sign in when prompted\n\n#### Method 2: Hosted MCP with a JWT (fallback)\n\nUse this when the client cannot complete OAuth, when you are testing in a browser MCP tester, or when you subscribe on RapidAPI and want the official hosted `tradingview_*` tools.\n\n> **⚠️ SECURITY WARNING**: Never commit your real API key or JWT token to version control. Keep them secure and private. The examples below use placeholders that you must replace.\n\n**Step 1**: Generate an MCP JWT\n\nConsole:\n\n```bash\ncurl --request POST \\\n  --url https://api.tradingviewapi.com/api/mcp/generate \\\n  --header 'Content-Type: application/json' \\\n  --header 'Authorization: Bearer <YOUR_API_KEY_HERE>' \\\n  --data '{}'\n```\n\nRapidAPI:\n\n```bash\ncurl --request POST \\\n  --url https://tradingview-data1.p.rapidapi.com/api/mcp/generate \\\n  --header 'Content-Type: application/json' \\\n  --header 'x-rapidapi-host: tradingview-data1.p.rapidapi.com' \\\n  --header 'x-rapidapi-key: <YOUR_RAPIDAPI_KEY_HERE>' \\\n  --data '{}'\n```\n\nThe response includes `exampleConfig` (`\"type\": \"http\"`, recommended for Cursor / VS Code) and `exampleConfigStreamableHttp` for older clients.\n\n**Step 2**: Put the token in the hosted URL config\n\n```json\n{\n  \"mcpServers\": {\n    \"tradingview\": {\n      \"type\": \"http\",\n      \"url\": \"https://mcp.tradingviewapi.com/mcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer <YOUR_JWT_TOKEN_HERE>\",\n        \"Accept\": \"application/json, text/event-stream\"\n      }\n    }\n  }\n}\n```\n\n#### Method 3: Local OpenAPI MCP for RapidAPI\n\nThis local `npx` server is for RapidAPI subscribers. It calls RapidAPI with your key and exposes OpenAPI tools. It is not the hosted TradingView MCP and does not use Console OAuth or the `tradingview_*` tool names.\n\n> **⚠️ SECURITY WARNING**: Never commit your real API key to version control. Keep your API key secure and private.\n\n```json\n{\n  \"mcpServers\": {\n    \"tradingview-data\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ivotoby/openapi-mcp-server\"],\n      \"env\": {\n        \"API_BASE_URL\": \"https://tradingview-data1.p.rapidapi.com\",\n        \"OPENAPI_SPEC_PATH\": \"https://www.tradingviewapi.com/openapi.json\",\n        \"API_HEADERS\": \"x-rapidapi-host:tradingview-data1.p.rapidapi.com,x-rapidapi-key: <YOUR_RAPIDAPI_KEY_HERE>\"\n      }\n    }\n  }\n}\n```\n\n#### Recommended Configuration\n\nFor Cursor, VS Code, and Claude, **Method 1 (Console OAuth) is recommended** because:\n- ✅ Only the hosted URL in the config file — no JWT to rotate\n- ✅ Browser sign-in through Console, then automatic refresh\n- ✅ Hosted `tradingview_*` tools at `mcp.tradingviewapi.com`\n- ✅ JWT (Method 2) remains available for RapidAPI and clients without OAuth\n- ✅ Local RapidAPI OpenAPI MCP (Method 3) remains available if you already subscribe there\n\n### 2. Verify Installation\n\nAfter restart, enter in conversation:\n\n```\nPlease call tradingview_get_metadata to get the list of supported markets\n```\n\nIf it returns the market list (america, china, japan, etc.), the configuration is successful.\n\n### 3. Start Using\n\nJust ask questions in natural language, for example:\n\n- \"Help me select strong stocks from China A-shares\"\n- \"Analyze the technical patterns of BTC/USDT\"\n- \"How is the China A-share market today?\"\n- \"I have 100k capital, want to buy a certain stock, how much should I buy?\"\n- \"Generate today's China financial news briefing\"\n- \"Do a fundamentals-first analysis of Apple\"\n- \"Screen US stocks with PE < 15, ROE > 15%, and RSI < 40\"\n- \"Show me the latest TradingView community sentiment on BTCUSDT\"\n- \"Build a G20 macro dashboard for next week\"\n\n## Usage Examples\n\n### Smart Stock Screening\n\n```\nHelp me select stocks from China A-share technology sector that meet the following conditions:\n- Technical: RSI 30-70, MACD golden cross\n- Fundamental: PE < 30, ROE > 15%\n- Market cap: above 5 billion\n```\n\n### Individual Stock Analysis\n\n```\nDeep analysis of Puyuan Information (688118), including:\n- Multi-timeframe technical analysis\n- Fundamental data\n- Recent news\n- Buy recommendations and risk warnings\n```\n\n### Market Review\n\n```\nHow is the China A-share market today? Analyze hot sectors and investment opportunities\n```\n\n### Risk Management\n\n```\nI have 100k capital, want to buy Puyuan Information, how much should I buy?\nGive me position suggestions, stop-loss/take-profit levels and risk-reward ratio\n```\n\n### Fundamental Deep Dive\n\n```\nAnalyze Apple from a fundamentals perspective:\n- business quality\n- revenue and margin trend\n- cash flow and balance sheet\n- dividend and analyst expectations\n```\n\n### Advanced Screener\n\n```\nScreen US stocks that satisfy:\n- PE < 20\n- ROE > 15%\n- RSI < 40\n- market cap above 10B\n```\n\n### Macro Dashboard\n\n```\nBuild a macro dashboard for the G20:\n- GDP growth ranking\n- inflation comparison\n- next 2 weeks economic calendar\n- likely impact on equities, bonds, and FX\n```\n\n## Supported Markets\n\n- 🇨🇳 **China A-shares** - SSE, SZSE, BSE\n- 🇺🇸 **United States** - NYSE, NASDAQ\n- 🇭🇰 **Hong Kong** - HKEX\n- 🇯🇵 **Japan** - TSE\n- 🇰🇷 **South Korea** - KRX\n- 🪙 **Cryptocurrency** - Binance, Coinbase, OKX, etc.\n- 💱 **Forex** - Major currency pairs\n- 📦 **Futures** - Commodity, index futures\n\nFor complete market list, see `tradingview-quantitative/references/api-documentation.md`.\n\n## Frequently Asked Questions\n\n### Q: What to do if prompted \"MCP server not found\"?\n\n**A**: Check the following points:\n1. Confirm the config file path (`~/.cursor/mcp.json` for Cursor)\n2. Confirm `\"type\": \"http\"` and `\"url\": \"https://mcp.tradingviewapi.com/mcp\"`\n3. Older clients may need `\"type\": \"streamable-http\"` instead of `\"http\"`\n4. Restart the MCP client after saving the config\n\n### Q: What to do if authentication fails?\n\n**A**:\n1. For OAuth: complete the Console browser sign-in and allow access\n2. Confirm the Console plan includes MCP (Pro does not)\n3. For JWT: regenerate with `POST /api/mcp/generate` — tokens expire by plan\n4. Do not put a Console API key in MCP `headers`; hosted MCP expects an MCP JWT or OAuth\n\n### Q: How to get China A-share data?\n\n**A**: \n```\n# First get market codes\ntradingview_get_metadata(type='markets')\n\n# Use market_code='china' to get A-share data\ntradingview_get_leaderboard(\n  asset_type='stocks', \n  tab='gainers',\n  market_code='china'\n)\n```\n\n### Q: Which technical indicators are supported?\n\n**A**: When calling `tradingview_get_ta`, set `include_indicators=true` to get:\n- Trend indicators: SMA, EMA, MACD, ADX\n- Momentum indicators: RSI, Stoch, CCI, Williams %R\n- Volume indicators: Volume, MFI\n- Support resistance: Pivot Points, Fibonacci\n- Others: ATR, Beta, Bollinger Bands\n\n### Q: How to get historical K-line data?\n\n**A**:\nUse `tradingview_get_ohlcv` for real Japanese candles (returns, stops, backtests). Use `tradingview_get_price` only when you need Heikin-Ashi or Range charts.\n\n```\ntradingview_get_ohlcv(\n  symbol='SSE:600519',    # Exchange:Code\n  timeframe='D',          # 1/5/15/30/60/240/D/W/M\n  range=120               # Max 500 K-lines\n)\n```\n\n### Q: Which languages are supported for news data?\n\n**A**: Supports 19 languages, commonly used are:\n- `zh-Hans` - Simplified Chinese\n- `en` - English\n- `ja` - Japanese\n- `ko` - Korean\n\nComplete list: `tradingview_get_metadata(type='languages')`\n\n### Q: How do I access company fundamentals and financial statements?\n\n**A**:\nUse `tradingview_get_market_data`:\n\n```\ntradingview_get_market_data(symbol='NASDAQ:AAPL', category='company')\ntradingview_get_market_data(symbol='NASDAQ:AAPL', category='indicators')\ntradingview_get_market_data(symbol='NASDAQ:AAPL', category='financials_quarterly')\ntradingview_get_market_data(symbol='NASDAQ:AAPL', category='dividend')\ntradingview_get_market_data(symbol='NASDAQ:AAPL', category='analyst_recommendations')\n```\n\nSee `tradingview-quantitative/references/fundamental-data-dive.md` for a complete analysis flow.\n\n### Q: How do I build a custom screener instead of using leaderboard tabs?\n\n**A**:\nUse the screener workflow in this order:\n1. `tradingview_get_screener_presets(asset_type='stock')`\n2. `tradingview_get_screener_filter_options(asset_type='stock', lang='en')`\n3. `tradingview_screen_assets` with `market`, `preset_fields`, `filters`, and `sort`\n\nSee `tradingview-quantitative/references/advanced-screener.md` and `tradingview-quantitative/references/api-documentation.md`.\n\n### Q: Can I analyze macro data and world economy indicators?\n\n**A**:\nYes. Combine:\n- `tradingview_get_world_economy_indicator_metadata`\n- `tradingview_get_world_economy_indicators(indicator, region='g20')`\n- `tradingview_get_calendar(type='economic', ...)`\n- `tradingview_get_news(market='economic', ...)`\n\nSee `tradingview-quantitative/references/macro-dashboard.md`.\n\n## Directory Structure\n\n```\ntradingview-quantitative-skills/\n├── README.md                    # This file - User guide\n├── README.zh.md                 # Chinese user guide\n├── SECURITY.md                  # Security policy and best practices\n├── .gitignore                   # Git ignore patterns for sensitive files\n└── tradingview-quantitative/    # AI skill package\n    ├── SKILL.md                 # AI instructions and workflow routing\n    └── references/              # Reference knowledge and workflow guides\n        ├── api-documentation.md # API documentation and metadata dictionary\n        ├── mcp-tools-guide.md   # MCP tools usage guide\n        ├── technical-analysis.md # Technical analysis methodology\n        ├── smart-screening.md   # Smart stock screening workflow\n        ├── deep-stock-analysis.md # Deep individual stock analysis workflow\n        └── ...                  # Other references and workflows\n```\n\n## Advanced Usage\n\n### Custom Screening Criteria\n\nRefer to `tradingview-quantitative/references/smart-screening.md` and `tradingview-quantitative/references/fundamental-screening.md`, you can combine:\n- Technical indicator screening (RSI, MACD, ADX, etc.)\n- Fundamental screening (PE, PB, ROE, dividend yield, etc.)\n- Market cap, volume screening\n- Industry sector screening\n\n### Multi-Market Comparative Analysis\n\n```\nCompare today's financial news from China, US, and Japan, analyze market differences\n```\n\n### Portfolio Strategy Backtesting\n\nCombining historical K-line data and technical indicators, simple strategy validation can be performed.\n\n## Technical Support\n\n- **API Documentation**: `tradingview-quantitative/references/api-documentation.md`\n- **Tools Guide**: `tradingview-quantitative/references/mcp-tools-guide.md`\n- **Practical Cases**: `tradingview-quantitative/references/us-stock-examples.md`\n\n## Disclaimer\n\nThis tool is for learning and research purposes only and does not constitute any investment advice. Investing involves risks; enter the market cautiously. Any investment decisions made using this tool are at your own risk.\n\n## License\n\nMIT License\n",
  "bytes": 14101,
  "sha": "6eb466efbff24fa4fcf230991b94c6fe1de02a9102f370c82c4daeae5b2c3cda",
  "repo_slug": "hypier/tradingview-quantitative-skills",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/skl_hypier_tradingview_quantitative_skills_t_9a6f8cf6/readme"
}