Tradingview Mcp Server

The most complete AI-powered trading toolkit for Claude and MCP clients. Backtesting + Live Sentiment + Yahoo Finance + 30+ Technical Analysis Tools โ€” all in one MCP server.

๐Ÿ“ˆ AI Trading Intelligence Framework โ€” MCP Server

The most complete AI-powered trading toolkit for Claude and MCP clients. Backtesting + Live Sentiment + Yahoo Finance + 30+ Technical Analysis Tools โ€” all in one MCP server.

License: MIT Python 3.10+ MCP Ready OpenClaw Ready Version PyPI GitHub Sponsors

โญ If this tool improves your workflow, please star the repo and consider sponsoring โ€” it keeps the project alive and growing!

Sponsor $5 Sponsor $15 Sponsor $30

๐ŸŽฅ Framework Demo

https://github-production-user-asset-6210df.s3.amazonaws.com/67838093/478689497-4a605d98-43e8-49a6-8d3a-559315f6c01d.mp4


๐Ÿ—๏ธ Architecture

tradingview-mcp Architecture


โœจ Why tradingview-mcp?

Featuretradingview-mcpTraditional SetupsBloomberg Terminal
Setup Time5 minutesHours (Docker, Conda...)Weeks (Contracts)
CostFree & Open SourceVariable$30k+/year
Backtestingโœ… 6 strategies + SharpeโŒ Manual scriptingโœ… Proprietary
Live Sentimentโœ… Reddit + RSS newsโŒ Separate setupโœ… Terminal
Market Dataโœ… Live / Real-TimeHistorical / DelayedLive
API KeysNone requiredMultiple (OpenAI, etc.)N/A

๐Ÿš€ Quick Start (5 Minutes)

Install via pip

pip install tradingview-mcp-server

Claude Desktop Config (claude_desktop_config.json)

{
  "mcpServers": {
    "tradingview": {
      "command": "uvx",
      "args": ["tradingview-mcp-server"]
    }
  }
}

Or run from source

git clone https://github.com/atilaahmettaner/tradingview-mcp
cd tradingview-mcp
uv run tradingview-mcp

๐Ÿ“ฑ Use via Telegram, WhatsApp & More (OpenClaw)

Connect this server to Telegram, WhatsApp, Discord and 20+ messaging platforms using OpenClaw โ€” a self-hosted AI gateway. Tested & verified on Hetzner VPS (Ubuntu 24.04).

How It Works

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. No MCP protocol needed between OpenClaw and the server; it's a direct Python import.

Telegram โ†’ OpenClaw agent (AI model) โ†’ trading.py (bash) โ†’ tradingview-mcp โ†’ Yahoo Finance

Quick Setup

# 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

Choose Your AI Model

OpenRouter is not required โ€” use whichever provider you have a key for:

ProviderModel ID for OpenClawGet Key
OpenRouter (aggregator โ€” access to all models)openrouter/google/gemini-3-flash-previewopenrouter.ai/keys
Anthropic (Claude direct)anthropic/claude-sonnet-4-5console.anthropic.com
Google (Gemini direct)google/gemini-2.5-flashaistudio.google.com
OpenAI (GPT direct)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.

โš ๏ธ Common Mistakes

SymptomCauseFix
Unrecognized keys: mcpServersmcpServers not supported in this versionRemove from config, use bash wrapper
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 won't startgateway.mode missingopenclaw config set gateway.mode local

Test Your Bot

Once running, send your Telegram bot:

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

๐Ÿ‘‰ Full OpenClaw Setup Guide โ†’


Unlike basic screeners, this framework deploys specialized AI agents that debate findings in real-time:

  1. ๐Ÿ› ๏ธ Technical Analyst โ€” Bollinger Bands (ยฑ3 proprietary rating), RSI, MACD
  2. ๐ŸŒŠ Sentiment & Momentum Analyst โ€” Reddit community sentiment + price momentum
  3. ๐Ÿ›ก๏ธ Risk Manager โ€” Volatility, drawdown risk, mean-reversion signals

Output: STRONG BUY / BUY / HOLD / SELL / STRONG SELL with confidence score


๐Ÿ”ง All 30+ MCP Tools

๐Ÿ“Š Backtesting Engine (New in v0.6.0)

ToolDescription
backtest_strategyBacktest 1 of 6 strategies with institutional metrics (Sharpe, Calmar, Expectancy)
compare_strategiesRun all 6 strategies on same symbol and rank by performance

6 Strategies to Test:

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

Metrics you get: Win Rate, Total Return, Sharpe Ratio, Calmar Ratio, Max Drawdown, Profit Factor, Expectancy, Best/Worst Trade, vs Buy-and-Hold, with realistic commission + slippage simulation.

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%

๐Ÿ’ฐ Yahoo Finance โ€” Real-Time Prices (New in v0.6.0)

ToolDescription
yahoo_priceReal-time quote: price, change %, 52w high/low, market state
market_snapshotGlobal overview: S&P500, NASDAQ, VIX, BTC, ETH, EUR/USD, SPY, GLD

Supports: Stocks (AAPL, TSLA, NVDA), Crypto (BTC-USD, ETH-USD, SOL-USD), ETFs (SPY, QQQ, GLD), Indices (^GSPC, ^DJI, ^IXIC, ^VIX), FX (EURUSD=X), Turkish (THYAO.IS, SASA.IS)


๐Ÿง  AI Sentiment & Intelligence (New in v0.5.0)

ToolDescription
market_sentimentReddit sentiment across finance communities (bullish/bearish score, top posts)
financial_newsLive RSS headlines from Reuters, CoinDesk, CoinTelegraph
combined_analysisPower Tool: TradingView technicals + Reddit sentiment + live news โ†’ confluence decision

๐Ÿ“ˆ Technical Analysis Core

ToolDescription
get_technical_analysisFull TA: RSI, MACD, Bollinger, 23 indicators with BUY/SELL/HOLD
get_multiple_analysisBulk TA for multiple symbols at once
get_bollinger_band_analysisProprietary ยฑ3 BB rating system
get_stock_decision3-layer decision engine (ranking + trade setup + quality score)
screen_stocksMulti-exchange screener with 20+ filter criteria
scan_by_signalScan by signal type (oversold, trending, breakout...)
get_candlestick_patterns15 candlestick pattern detector
get_multi_timeframe_analysisWeeklyโ†’Dailyโ†’4Hโ†’1Hโ†’15m alignment analysis

๐ŸŒ Multi-Exchange Support

ExchangeTools
BinanceCrypto screener, all pairs
KuCoin / Bybit+Crypto screener
NASDAQ / NYSEUS stocks (AAPL, TSLA, NVDA...)
EGX (Egypt)egx_market_overview, egx_stock_screener, egx_trade_plan, egx_fibonacci_retracement
Turkish (BIST)Via TradingView screener

๐Ÿ’ฌ Example AI Conversations

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)

๐Ÿ’– Support the Project

This framework is free and open source, built in spare time. If it saves you hours of research or helps you make better decisions, please consider sponsoring:

TierMonthlyWhat You Get
โ˜• Coffee$5Heartfelt gratitude + name in README
๐Ÿš€ Supporter$15Above + priority bug fixes
๐Ÿ’Ž Pro$30Above + priority feature requests
Sponsor

Every sponsor directly funds new features like Walk-Forward Backtesting, Twitter/X sentiment, and managed cloud hosting.


๐Ÿ“‹ Roadmap

  • TradingView technical analysis (30+ indicators)
  • Multi-exchange screener (Binance, KuCoin, EGX, US stocks)
  • Reddit sentiment analysis
  • Live financial news (RSS)
  • Yahoo Finance real-time prices
  • Backtesting engine (6 strategies + Sharpe/Calmar/Expectancy)
  • Walk-forward backtesting (overfitting detection)
  • Twitter/X market sentiment
  • Paper trading simulation
  • Managed cloud hosting (no local setup)

๐Ÿ“„ License

MIT License โ€” see LICENSE for details.


Disclaimer: This tool is for educational and research purposes only. It does not constitute financial advice. Always do your own research before making investment decisions.

๊ด€๋ จ ์„œ๋ฒ„