交易视图-MCP | tradingview-mcp | 外汇指标下载 - MT4/MT5资源 #27474
实时加密货币和股票筛选、先进技术指标、布林线情报、烛台模式 + 原生 Claude 桌面集成。多交易所(Binance、KuCoin、Bybit+)。开源人工智能交易基础设施。
📈 AI交易智能框架 — MCP服务器
为Claude和MCP客户打造的最完整的AI驱动交易工具包。回测 + 实时情感 + 雅虎财经 + 30+ 技术分析工具——全部集成在一个MCP服务器上。⭐ 如果这个工具能改善你的工作流程,请给仓库加星并考虑sponsoring——它让项目得以持续发展和发展!
🚀 Don't want to fightuv/pandas/ Python on Windows? pro.cryptosieve.com — same 30+ tools, one connector URL into Claude.ai, ChatGPT, Copilot, Cursor. $9/month with 7-day free trial. Self-hosting is free and always will be; the hosted version is just for folks who'd rather skip the ops dance.
🎥 框架演示
https://github-production-user-asset-6210df.s3.amazonaws.com/67838093/478689497-4a605d98-43e8-49a6-8d3a-559315f6c01d.mp4
🏗️ 建筑
✨ 为什么选择tradingview-mcp?
| Feature | tradingview-mcp | 传统设置 | 彭博终端 |
|---|---|---|---|
| 搭建时间 | 5分钟 | 小时数(Docker,Conda......) | Weeks(合同) |
| Cost | 自由与开源 | Variable | $30k+/year |
| Backtesting | ✅ 6种策略 + 夏珀 | ❌ 手动脚本 | ✅ 专有 |
| 现场情感 | ✅ Reddit + RSS 新闻 | ❌ 独立设置 | ✅ 航站楼 |
| 市场数据 | ✅ 实时 / 实时 | 历史/延迟 | Live |
| API 密钥 | 不需要 | 多个(比如OpenAI等等) | N/A |
🚀 快速入门(5分钟)
通过PIP安装
pip install tradingview-mcp-server
Claude Desktop Config (claude_desktop_config.json)
Note: On macOS, GUI apps like Claude Desktop may not have~/.local/binin their PATH. Use the full path touvxto avoid "command not found" errors.
{
"mcpServers": {
"tradingview": {
"command": "/Users/YOUR_USERNAME/.local/bin/uvx",
"args": ["--from", "tradingview-mcp-server", "tradingview-mcp"]
}
}
}
On Linux, replace /Users/YOUR_USERNAME with /home/YOUR_USERNAME. On Windows, use %USERPROFILE%\.local\bin\uvx.exe.
Codex 插件配置
该仓库还包含仅限MCP的Codex插件元数据:
.codex-plugin/plugin.json.codex-mcp.json
{
"mcpServers": {
"tradingview": {
"command": "uvx",
"args": ["--from", "tradingview-mcp-server", "tradingview-mcp"]
}
}
}
After installing or enabling the Codex plugin, restart Codex so the MCP server is loaded in the next session. Depending on your Codex version, codex mcp list may show registered MCP servers, but tool availability should be verified in a fresh Codex session.
或者直接跑出源头
git clone https://github.com/atilaahmettaner/tradingview-mcp
cd tradingview-mcp
uv run tradingview-mcp
🛠️ 故障排除
🪟 Windows: MCP error -32001: Request timed out on first launch
症状——你在添加配置后不久,会在Claude桌面日志中看到这个:
[tradingview] Server started and connected successfully
[tradingview] Message from client: initialize ...
[60 seconds later]
[tradingview] notifications/cancelled — reason: "MCP error -32001: Request timed out"
为什么会这样: on Windows with Python 3.14, uvx downloads tradingview-mcp-server, creates a fresh virtualenv, and installs dependencies the first time it runs. Because pandas has no prebuilt wheel for Python 3.14 yet, pip falls back to a source build — which typically exceeds Claude Desktop's 60-second MCP initialization timeout.
修复 — 钉住到 Python 3.13(已有预建的 pandas 轮子):
{
"mcpServers": {
"tradingview": {
"command": "uvx",
"args": ["--python", "3.13", "--from", "tradingview-mcp-server", "tradingview-mcp"]
}
}
}
On macOS use the full path to uvx (see the note in Quick Start). On Windows uvx is typically %USERPROFILE%\.local\bin\uvx.exe.
# Run in a terminal before launching Claude Desktop
uv tool install --python 3.13 tradingview-mcp-server
安装完成后,用正常配置启动Claude Desktop,服务器会立即启动(缓存已经热)。
_Credit: @wyh4444关于原始报告#24.
📱 通过Telegram、WhatsApp等方式使用(OpenClaw)
将此服务器连接到Telegram、WhatsApp、Discord以及使用 20+ 消息平台的OpenClaw—— 一个自托管的人工智能网关。在 Hetzner VPS(Ubuntu 24.04)上测试并验证。
工作原理
OpenClaw routes Telegram messages to an AI agent. The agent usestrading.py— a thin Python wrapper — to calltradingview-mcpfunctions and return formatted results. OpenClaw 与服务器之间无需 MCP 协议;它是直接导入的Python。
Telegram → OpenClaw agent (AI model) → trading.py (bash) → tradingview-mcp → Yahoo Finance
快速设置
# 1. Install UV and tradingview-mcp
curl -LsSf https://astral.sh/uv/install.sh | sh && source ~/.bashrc
uv tool install tradingview-mcp-server
# 2. Configure OpenClaw channels
cat > ~/.openclaw/openclaw.json << 'EOF'
{
channels: {
telegram: {
botToken: "YOUR_BOT_TOKEN_HERE",
},
},
}
EOF
# 3. Configure gateway + agent
openclaw config set gateway.mode local
openclaw config set acp.defaultAgent main
# 4. Set your AI model (choose ONE option below)
openclaw configure --section model
# 5. Install the skill + tool wrapper
mkdir -p ~/.agents/skills/tradingview-mcp ~/.openclaw/tools
curl -fsSL https://raw.githubusercontent.com/atilaahmettaner/tradingview-mcp/main/openclaw/SKILL.md \
-o ~/.agents/skills/tradingview-mcp/SKILL.md
curl -fsSL https://raw.githubusercontent.com/atilaahmettaner/tradingview-mcp/main/openclaw/trading.py \
-o ~/.openclaw/tools/trading.py && chmod +x ~/.openclaw/tools/trading.py
# 6. Start the gateway
openclaw gateway install
systemctl --user start openclaw-gateway.service
选择你的AI模型
OpenRouter 是非必需——使用您拥有密钥的供应商:
| Provider | OpenClaw 的型号标识 | Get Key |
|---|---|---|
| OpenRouter(聚合器——访问所有模型) | openrouter/google/gemini-3-flash-preview | openrouter.ai/keys |
| Anthropic(克洛德直接说) | anthropic/claude-sonnet-4-5 | console.anthropic.com |
| Google(双子座直达) | google/gemini-2.5-flash | aistudio.google.com |
| OpenAI(GPT 直通) | openai/gpt-4o-mini | platform.openai.com |
# Examples — set your chosen model:
openclaw config set agents.defaults.model "openrouter/google/gemini-3-flash-preview" # via OpenRouter
openclaw config set agents.defaults.model "anthropic/claude-sonnet-4-5" # Anthropic direct
openclaw config set agents.defaults.model "google/gemini-2.5-flash" # Google direct
⚠️ Important: Prefix must match your provider.google/...needs a Google API key.openrouter/...needs an OpenRouter key.
⚠️ 常见错误
| Symptom | Cause | Fix |
|---|---|---|
Unrecognized keys: mcpServers | mcpServers not supported in this version | 从配置中移除,使用bash封装工具 |
No API key for provider "google" | Used google/model but only have OpenRouter key | Use openrouter/google/model instead |
which agent? loop | acp.defaultAgent not set | openclaw config set acp.defaultAgent main |
| 网关无法启动 | gateway.mode missing | openclaw config set gateway.mode local |
测试你的机器人
运行后,发送你的Telegram机器人:
market snapshot
backtest RSI strategy for AAPL, 1 year
compare all strategies for BTC-USD
与基础筛选器不同,该框架部署专业人工智能代理辩论的实时结果:
- 🛠️ 技术分析师—— 布林带(±3专有评级)、RSI、MACD
- 🌊 情绪与动量分析师—— Reddit社区情绪 + 价格动能
- 🛡️ 风险管理师——波动率、回撤风险、均值回归信号
STRONG BUY / BUY / HOLD / SELL / STRONG SELL with confidence score
🔧 所有30+ MCP工具
📊 回测引擎(New in v0.6.0)
| Tool | Description |
|---|---|
backtest_strategy | 用机构指标(Sharpe、Calmar、Expectancy)回测6种策略中的1种 |
compare_strategies | 在同一个符号上运行所有6种策略,并按表现排名 |
rsi— RSI oversold/overbought mean reversionbollinger— Bollinger Band mean reversionmacd— MACD golden/death crossema_cross— EMA 20/50 Golden/Death Crosssupertrend— ATR-based Supertrend trend following 🔥donchian— Donchian Channel breakout (Turtle Trader style)
Example prompt: "Compare all strategies on BTC-USD for 2 years"
→ #1 Supertrend: +31.5% | Sharpe: 2.1 | WR: 62%
→ #2 Bollinger: +18.3% | Sharpe: 3.4 | WR: 75%
→ Buy & Hold: -5.0%
💰 雅虎财经——实时价格(New in v0.6.0)
| Tool | Description |
|---|---|
yahoo_price | 实时报价:价格、变动百分比、52瓦高低、市场状态 |
market_snapshot | 全球概览:标普500、纳斯达克、VIX、BTC、ETH、EUR/USD、SPY、GLD |
🧠 人工智能情感与智能(New in v0.5.0)
| Tool | Description |
|---|---|
market_sentiment | Reddit在金融社区的情绪(看涨/看跌评分,热门帖子) |
financial_news | 来自路透社、CoinDesk、CoinTelegraph的实时RSS头条 |
combined_analysis | 电动工具: TradingView 技术分析 + Reddit 情绪 + 汇流决策→实时新闻 |
📈 技术分析核心
| Tool | Description |
|---|---|
get_technical_analysis | 完整TA:RSI、MACD、布林基指数,23个指标,含买卖/持有 |
get_multiple_analysis | 多个符号的批量TA |
get_bollinger_band_analysis | 专有的±3战列评级系统 |
get_stock_decision | 三层决策引擎(排名 + 交易设置 + 质量评分) |
screen_stocks | 多交换筛选器,采用20+滤波标准 |
scan_by_signal | 按信号类型扫描(超卖、趋势、突破......) |
get_candlestick_patterns | 15 烛台模式探测器 |
get_multi_timeframe_analysis | 每周→日→4小时→1小时→15分钟的对齐分析 |
🌍 多交换支持(Multi Exchange)
| Exchange | Tools |
|---|---|
| Binance | 加密筛选器,所有对子 |
| KuCoin / Bybit+ | 加密货币筛选器 |
| 纳斯达克 / 纽约证券交易所 | 美国股票(AAPL、TSLA、NVDA......) |
| EGX(埃及) | egx_market_overview, egx_stock_screener, egx_trade_plan, egx_fibonacci_retracement |
| 土耳其语(BIST) | 通过TradingView筛选器 |
💬 示例 AI 对话
You: "Give me a full market snapshot right now"
AI: [market_snapshot] → S&P500 -3.4%, BTC +0.1%, VIX 31 (+13%), EUR/USD 1.15
You: "What is Reddit saying about NVDA?"
AI: [market_sentiment] → Strongly Bullish (0.41) | 23 posts | 18 bullish
You: "Backtest RSI strategy on BTC-USD for 2 years"
AI: [backtest_strategy] → +31.5% return | 100% win rate | 2 trades | B&H: -5%
You: "Which strategy worked best on AAPL in the last 2 years?"
AI: [compare_strategies] → Supertrend #1 (+14.6%, Sharpe 3.09), MACD last (-9.1%)
You: "Analyze TSLA with all signals: technical + sentiment + news"
AI: [combined_analysis] → BUY (Technical STRONG BUY + Bullish Reddit + Positive news)
💖 支持项目
该框架是自由且开源,业余时间内建的。如果这能帮你节省数小时的研究时间或帮助你做出更好的决策,请考虑赞助:
| Tier | Monthly | 你得到了什么 |
|---|---|---|
| ☕ 咖啡 | $5 | 衷心感谢 + README 中的姓名 |
| 🚀 支持者 | $15 | 以上 + 优先级漏洞修复 |
| 💎 Pro | $30 | 以上 + 优先级功能请求 |
每个赞助商都直接资助新功能,如前进回测、Twitter/X情感和托管云托管。
📋 路线图
- [x] TradingView 技术分析(30+指标)
- [x] 多交易所筛选器(币安、KuCoin、MEXC、EGX、美国股票)
- [x] Reddit情感分析
- [x] 实时财经新闻(RSS)
- [x] 雅虎财经实时价格
- [x] 回测引擎(6种策略 + Sharpe/Calmar/Expectancy)
- [ ] 向前行进回测(过拟合检测)
- [ ] Twitter/X市场情绪
- [ ] 纸币交易模拟
- [ ] 托管云主机(无本地设置)
📄 许可
麻省理工学院执照——参见LICENSE细节。
免责声明:本工具仅供教育和研究用途。这不构成财务建议。在做投资决策前,务必自行做好调研。
💡 精彩内容推荐
✍️ 楼主最新发布
- •
- •
- •
- •
- •
- •
📌 热门专题入口
- •
- •
- •
- •
- •
- •
- •
- •
🔗 您可能感兴趣
- •
- •
- •
- •
- •
- •