欢迎访问 外汇EA下载与MT4/MT5自动交易资源 - 聚合外汇EA、黄金EA、量化交易工具与自动化交易实战内容。
登录 注册

交易视图-MCP | tradingview-mcp | 外汇指标下载 - MT4/MT5资源 #27474

author emer | 86 人阅读 | 0 人评论 |

实时加密货币和股票筛选、先进技术指标、布林线情报、烛台模式 + 原生 Claude 桌面集成。多交易所(Binance、KuCoin、Bybit+)。开源人工智能交易基础设施。

📈 AI交易智能框架 — MCP服务器

atilaahmettaner%2Ftradingview-mcp | Trendshift 为Claude和MCP客户打造的最完整的AI驱动交易工具包。回测 + 实时情感 + 雅虎财经 + 30+ 技术分析工具——全部集成在一个MCP服务器上。
⭐ 如果这个工具能改善你的工作流程,请给仓库加星并考虑sponsoring——它让项目得以持续发展和发展!
🚀 Don't want to fight uv / 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 Architecture

✨ 为什么选择tradingview-mcp?

Featuretradingview-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/bin in their PATH. Use the full path to uvx to 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
The plugin uses the same PyPI package entrypoint:
{
  "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.

另一种选择——先预装一次,然后让Claude Desktop重用缓存:
# 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 uses trading.py — a thin Python wrapper — to call tradingview-mcp functions 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 是非必需——使用您拥有密钥的供应商:

ProviderOpenClaw 的型号标识Get Key
OpenRouter(聚合器——访问所有模型)openrouter/google/gemini-3-flash-previewopenrouter.ai/keys
Anthropic(克洛德直接说)anthropic/claude-sonnet-4-5console.anthropic.com
Google(双子座直达)google/gemini-2.5-flashaistudio.google.com
OpenAI(GPT 直通)openai/gpt-4o-miniplatform.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.

⚠️ 常见错误

SymptomCauseFix
Unrecognized keys: mcpServersmcpServers not supported in this version从配置中移除,使用bash封装工具
No API key for provider "google"Used google/model but only have OpenRouter keyUse openrouter/google/model instead
which agent? loopacp.defaultAgent not setopenclaw config set acp.defaultAgent main
网关无法启动gateway.mode missingopenclaw config set gateway.mode local

测试你的机器人

运行后,发送你的Telegram机器人:

market snapshot
backtest RSI strategy for AAPL, 1 year
compare all strategies for BTC-USD

👉 完整的OpenClaw设置指南→


与基础筛选器不同,该框架部署专业人工智能代理辩论的实时结果:
  1. 🛠️ 技术分析师—— 布林带(±3专有评级)、RSI、MACD
  2. 🌊 情绪与动量分析师—— Reddit社区情绪 + 价格动能
  3. 🛡️ 风险管理师——波动率、回撤风险、均值回归信号
Output: STRONG BUY / BUY / HOLD / SELL / STRONG SELL with confidence score

🔧 所有30+ MCP工具

📊 回测引擎(New in v0.6.0)

ToolDescription
backtest_strategy用机构指标(Sharpe、Calmar、Expectancy)回测6种策略中的1种
compare_strategies在同一个符号上运行所有6种策略,并按表现排名
6个测试策略:
  • rsi — RSI oversold/overbought mean reversion
  • bollinger — Bollinger Band mean reversion
  • macd — MACD golden/death cross
  • ema_cross — EMA 20/50 Golden/Death Cross
  • supertrend — 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)

ToolDescription
yahoo_price实时报价:价格、变动百分比、52瓦高低、市场状态
market_snapshot全球概览:标普500、纳斯达克、VIX、BTC、ETH、EUR/USD、SPY、GLD
Supports:股票(AAPL、TSLA、NVDA)、加密货币(BTC-USD、ETH-USD、SOL-USD)、ETF(SPY、QQQ、GLD)、指数(^GSPC、^DJI、^IXIC、^VIX)、外汇(EURUSD=X)、土耳其(THYAO.IS、SASA.IS)

🧠 人工智能情感与智能(New in v0.5.0)

ToolDescription
market_sentimentReddit在金融社区的情绪(看涨/看跌评分,热门帖子)
financial_news来自路透社、CoinDesk、CoinTelegraph的实时RSS头条
combined_analysis电动工具: TradingView 技术分析 + Reddit 情绪 + 汇流决策→实时新闻

📈 技术分析核心

ToolDescription
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_patterns15 烛台模式探测器
get_multi_timeframe_analysis每周→日→4小时→1小时→15分钟的对齐分析

🌍 多交换支持(Multi Exchange)

ExchangeTools
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)

💖 支持项目

该框架是自由且开源,业余时间内建的。如果这能帮你节省数小时的研究时间或帮助你做出更好的决策,请考虑赞助:

TierMonthly你得到了什么
☕ 咖啡$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细节。


免责声明:本工具仅供教育和研究用途。这不构成财务建议。在做投资决策前,务必自行做好调研。

文章来源:https://github.com/atilaahmettaner/tradingview-mcp

🔐
请登录后参与评论
注册满12小时后评论,即可解锁附件下载
立即登录