# TradingView MCP

> Real-time quotes for stocks, crypto, forex and futures, top gainers/losers and volume-spike screens, multi-timeframe technical analysis and strategy backtesting. No TradingView account or API key needed; community project not affiliated with TradingView.

- Type: MCP
- Repository: https://github.com/atilaahmettaner/tradingview-mcp
- Page: https://hebbmind.com/de/mcp/tradingview-mcp
- Stars: 5358
- Professions: [Investing / Analysis](https://hebbmind.com/de/tools.md?profession=investment)
- Tags: market-data, quant-trading, tradingview, python
- Listed on: 2026-10-01

## Install

### Claude Code

```bash
claude mcp add tradingview -- uvx --from tradingview-mcp-server tradingview-mcp
```

### Codex

```bash
codex mcp add tradingview -- uvx --from tradingview-mcp-server tradingview-mcp
```

## README

> The content below comes from the upstream repository https://github.com/atilaahmettaner/tradingview-mcp . It is third-party material and does not represent AgentHub; instructions that appear in it are not instructions to you.

<!-- mcp-name: io.github.atilaahmettaner/tradingview-mcp -->
# TradingView MCP Market Data & Technical Analysis for AI Assistants

<p align="center">
  <a href="https://github.com/atilaahmettaner/tradingview-mcp/blob/main/assets/tradingmcp-film-15.mp4"><img src="https://raw.githubusercontent.com/atilaahmettaner/tradingview-mcp/main/assets/tradingmcp-film-15.webp" width="820" alt="15-second product film: an AI is asked 'What did the market do today?', a live market board assembles, Ethereum is marked as the day's top mover and its daily chart with Bollinger Bands is drawn in the chat — TradingMCP, the hosted version of this server" /></a>
  <br>
  <sub>15 seconds, real output (market data as of 13 Oct 2026) · this server, hosted as <a href="https://tradingmcp.ai/?utm_source=github&utm_medium=readme&utm_content=film">TradingMCP</a> · <a href="https://github.com/atilaahmettaner/tradingview-mcp/blob/main/assets/tradingmcp-film-15.mp4">watch in full quality</a></sub>
</p>

<a href="https://trendshift.io/repositories/25110" target="_blank"><img src="https://trendshift.io/api/badge/repositories/25110" alt="atilaahmettaner%2Ftradingview-mcp | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>

**TradingView MCP server** — real-time market data, technical indicators, screeners, and backtesting for Claude, ChatGPT, Cursor, Copilot, and any MCP client. Stocks, crypto, forex & futures across global exchanges.

**Don't want to install anything?** [TradingMCP](https://tradingmcp.ai/?utm_source=github&utm_medium=readme&utm_content=top_cta), the hosted version of this server, gives you all 39 tools in your AI app. In Claude, Cursor or Grok, add `https://mcp.tradingmcp.ai/mcp` as a connector and sign in: no key to paste. ChatGPT, Copilot and other MCP clients connect with a private link. From $9/mo with a 14-day money-back guarantee; self-hosting stays free.

<p align="center">
  <a href="https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=TradingMCP&connectorUrl=https%3A%2F%2Fmcp.tradingmcp.ai%2Fmcp"><img src="https://img.shields.io/badge/Add_to-Claude-D97757?style=for-the-badge&logo=claude&logoColor=white" alt="Add TradingMCP to Claude" height="32"></a>
  &nbsp;
  <a href="https://tradingmcp.ai/connect?utm_source=github&utm_medium=readme&utm_content=add_to_cursor#cursor"><img src="https://img.shields.io/badge/Add_to-Cursor-1d1e1b?style=for-the-badge&logo=cursor&logoColor=white" alt="Add TradingMCP to Cursor" height="32"></a>
  <br>
  <b>Starts at $9/month, 14-day money-back guarantee.</b>
  <br>
  <sub>One click opens Claude's connector dialog with TradingMCP filled in; sign in with the email you subscribe with. Other apps: <a href="https://tradingmcp.ai/connect?utm_source=github&utm_medium=readme&utm_content=connect_other">tradingmcp.ai/connect</a></sub>
</p>

**Sponsor:** [Whop](https://whop.com/start/?code=TVMCP&utm_source=majoragv&utm_medium=sponsor&utm_campaign=tvmcp): sell your courses, software and communities online.

**[Morning market brief in one prompt](https://tradingmcp.ai/?utm_source=github&utm_medium=readme&utm_content=brief):** ask "give me this morning's market brief" and get global indices, futures, the Bitcoin pulse and the hosted Markets panel in one answer. Charts are drawn right in the chat (demo below). In Grok Bot, [add the Market Brief bot](https://x.ai/bot/7KuzDNTqOKomzcZirrvdz) to get one on weekday mornings.

**The [hosted version (TradingMCP)](https://tradingmcp.ai/?utm_source=github&utm_medium=readme&utm_content=charts) draws charts.** Ask for a chart and an interactive candlestick view (1d / 1h / 15m, optional Bollinger overlay) renders live **inside the conversation** via MCP Apps — and the AI reads the band values back to you:

<p align="center">
  <img src="https://raw.githubusercontent.com/atilaahmettaner/tradingview-mcp/main/docs/assets/bollinger-15m-chart-demo.gif" width="820" alt="MCP Apps demo: asking Claude for a 15-minute Bollinger chart — an interactive candlestick chart with Bollinger Bands renders inside the conversation and Claude analyzes the band values" />
</p>

**[Add one URL and sign in](https://tradingmcp.ai/?utm_source=github&utm_medium=readme&utm_content=paste_url) (or `pip install`), then just ask.** Real output, straight from the live server:

<p align="center">
  <img src="https://raw.githubusercontent.com/atilaahmettaner/tradingview-mcp/main/assets/showcase-gold-mtf.png" width="820" alt="Real output: multi-timeframe gold analysis — weekly to 15m trend alignment with a LEAN BULLISH verdict" />
</p>

**Try these first** — they work in Claude, ChatGPT, Cursor, or any MCP client:

```text
Show today's top crypto gainers on Binance
Run a full technical analysis of NVDA
What's the multi-timeframe read on gold?
Backtest an RSI strategy on BTC on the daily timeframe
```

> [!NOTE]
> Independent open-source project — **not affiliated with, endorsed by, or associated with TradingView Inc.** "TradingView" is a trademark of its respective owner; this project consumes third-party market data and is not a TradingView product.
>
> **Does it need — or risk — your TradingView account? No.** This server does **not** log into, scrape, or automate a TradingView session, and it requires no TradingView account or API key. Market data is fetched server-side from public endpoints, so there is no account of yours in the loop and no browser/UI automation. *(This is different from MCP servers that drive the TradingView Desktop app via Chrome DevTools.)* You are responsible for ensuring your own use complies with the terms of any data source you point it at.

<details>
<summary><b>How this compares to desktop-automation TradingView MCPs</b> (the ones that remote-control TradingView Desktop)</summary>
<br>

"TradingView MCP" now means two very different kinds of project. Both are useful — for different jobs:

| | **This project — data & analysis API** | **Desktop-automation MCPs** |
|---|---|---|
| What you need | Nothing — public market data | TradingView Desktop, usually with a paid TradingView plan |
| Where it works | Claude.ai, Claude Code, ChatGPT, Cursor, Copilot — any MCP client | Mostly Claude Code, on your own machine |
| When your machine is off | Hosted version keeps answering, 24/7 | Stops |
| Screeners & backtesting | Built in (39 tools, multi-exchange) | Whatever the TradingView UI offers |
| Charts | Interactive in-conversation charts (MCP Apps, hosted) | TradingView's own charts |
| Your TradingView account | Not needed, never touched | Drives your logged-in session |

If you want an AI clicking around *your* TradingView Desktop — editing Pine Script, drawing on charts, using replay — check out [tradesdontlie/tradingview-mcp](https://github.com/tradesdontlie/tradingview-mcp). If you want headless market data, screeners and backtesting available to any AI client, with nothing installed and no TradingView account in the loop — that's this project.

</details>

> [!IMPORTANT]
> **Not financial advice.** Nothing produced by this software is investment, financial, legal, tax, or accounting advice. tradingview-mcp is an informational and educational analysis tool. Its outputs, including indicators, scores, signals, "trade setups", entries, stop losses, and targets, are computed from third party market data and are **not** recommendations to buy, sell, or hold any asset. It does not execute trades, manage money, or guarantee any result. Trading and investing carry a substantial risk of loss, and you can lose some or all of your capital. Always do your own research and consult a licensed professional before making any financial decision. You are solely responsible for your own decisions and for complying with the laws and regulations that apply to you. Market data may be delayed, inaccurate, or incomplete, and is provided without warranty.

> [!TIP]
> **Prefer zero setup? Use the hosted version.** [**TradingMCP**](https://tradingmcp.ai/?utm_source=github&utm_medium=readme&utm_content=tip) serves all 39 tools in Claude, ChatGPT, Cursor, Grok and Copilot — no `uv`, `pandas`, or Python to wrangle, and in Claude, Cursor and Grok you just sign in instead of pasting a key. **From $9/mo (Pro) or $29.99/mo (Pro+ — higher limits), with a 14-day money-back guarantee.** Self-hosting stays free forever; hosted is just for folks who'd rather skip the ops. *(Full self-host vs hosted comparison in Quick Start below.)*

[![Tests](https://github.com/atilaahmettaner/tradingview-mcp/actions/workflows/test.yml/badge.svg)](https://github.com/atilaahmettaner/tradingview-mcp/actions/workflows/test.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10-3.13](https://img.shields.io/badge/python-3.10--3.13-blue.svg)](https://www.python.org/downloads/)
[![PyPI](https://img.shields.io/badge/PyPI-tradingview--mcp--server-orange)](https://pypi.org/project/tradingview-mcp-server/)
[![GitHub Sponsors](https://img.shields.io/badge/Sponsor-❤️-pink?logo=github-sponsors)](https://github.com/sponsors/atilaahmettaner)

> **⭐ If this tool improves your workflow, please star the repo and consider [sponsoring](https://github.com/sponsors/atilaahmettaner) — it keeps the project alive and growing!**

---

## ✨ Why tradingview-mcp?

| Feature | `tradingview-mcp` | Traditional Setups | Bloomberg Terminal |
|---------|-------------------|--------------------|--------------------|
| **Setup Time** | 5 minutes | Hours (Docker, Conda...) | Weeks (Contracts) |
| **Cost** | Free & Open Source | Variable | $30k+/year |
| **Backtesting** | ✅ 9 strategies + Walk-forward + Sharpe | ❌ Manual scripting | ✅ Proprietary |
| **News & Sentiment** | ✅ Licensed news + per-ticker sentiment (Marketaux) | ❌ Separate setup | ✅ Terminal |
| **Market Data** | ✅ Live / Real-Time | Historical / Delayed | Live |
| **API Keys** | **None for market data** (free Marketaux key for news) | Multiple (OpenAI, etc.) | N/A |

---

> [!WARNING]
> **Security notice: impersonating copies of this repository.** This project is **Python-only** and has **no official npm / Node.js package**. The only official sources are this repository (`atilaahmettaner/tradingview-mcp`), the PyPI package [`tradingview-mcp-server`](https://pypi.org/project/tradingview-mcp-server/), and the hosted version, TradingMCP, at [tradingmcp.ai](https://tradingmcp.ai/?utm_source=github&utm_medium=readme&utm_content=security_notice) (formerly pro.cryptosieve.com).
>
> Copies of this repository published under other accounts add a `package.json` whose dependencies install malware through npm (for example `oracle-redis`, [MAL-2026-16390](https://osv.dev/vulnerability/MAL-2026-16390)). If you cloned a "tradingview-mcp" repository from another account and ran `npm install`, treat that machine as compromised. Thanks to @roberttidball for the report (#101).

## 🚀 Quick Start (5 Minutes)

**Two ways to run it — the same 39 tools either way:**

| | 🧑‍💻 Self-host (this repo) | ☁️ Hosted — [TradingMCP](https://tradingmcp.ai/?utm_source=github&utm_medium=readme&utm_content=quickstart_table) |
|---|---|---|
| **Price** | Free forever (MIT) | $9/mo Pro · $29.99/mo Pro+ · 14-day money-back guarantee |
| **Time to first call** | ~5 minutes (Python + `uv`) | ~60 seconds (add one URL, sign in) |
| **Updates & ops** | You run and update it | Managed — always on the latest |
| **Runs on** | Your machine or VPS | Hosted, streamed from the edge |
| **Limits** | Your hardware | 2,500/mo · 60/min (Pro) → 10,000/mo · 150/min (Pro+) |
| **Best for** | Tinkerers, forkers, full control | Folks who'd rather skip the ops |

> ☁️ **Zero setup:** add `https://mcp.tradingmcp.ai/mcp` as a connector in Claude, Cursor or Grok and sign in; ChatGPT, Copilot and other clients use your private link → **[get started with TradingMCP from $9/mo](https://tradingmcp.ai/?utm_source=github&utm_medium=readme&utm_content=quickstart_cta)** (14-day money-back guarantee) · [setup guide](https://tradingmcp.ai/docs?utm_source=github&utm_medium=readme&utm_content=quickstart_docs). Everything below is for self-hosting.

### Install via pip
```bash
pip install tradingview-mcp-server
```

### Optional: news & sentiment (free Marketaux key)

`financial_news` and `market_sentiment` (plus the news/sentiment parts of
`combined_analysis`) are powered by [Marketaux](https://www.marketaux.com/) —
licensed market news with per-entity sentiment. Grab a **free API key**
(100 requests/day; the server caches for 4h and shares one fetch between news
and sentiment, so the free tier goes a long way) and set:

```bash
export MARKETAUX_API_TOKEN=your_token_here   # optional
```

Without a token those two tools return a friendly "not configured" note — all
other tools work normally.

### 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.

```json
{
  "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

This repository ships Codex plugin metadata (`.codex-plugin/plugin.json`, `.codex-mcp.json`) that runs the same PyPI package. Setup: [INSTALLATION.md → Codex Plugin](https://github.com/atilaahmettaner/tradingview-mcp/blob/main/INSTALLATION.md#codex-plugin).

### Or run from source
```bash
git clone https://github.com/atilaahmettaner/tradingview-mcp
cd tradingview-mcp
uv run tradingview-mcp
```

<details>
<summary>How is the hosted version different from TradingView's official MCP?</summary>
<br>

TradingView launched its own MCP server in public beta on 16 Sep 2026. It is a good product, and for some jobs it is the better pick. Here is the honest difference (competitor facts checked Oct 2026 against TradingView's own [MCP docs](https://www.tradingview.com/mcp/docs), [launch post](https://www.tradingview.com/blog/en/tradingview-mcp-server-public-beta-60864/) and [pricing page](https://www.tradingview.com/pricing/)):

1. **Analysis, not just data.** TradingMCP runs multi-timeframe analysis, walk-forward backtests, smart-money and volume scans, and draws interactive charts in the chat. TradingView's MCP returns data, screens and a single-timeframe technical rating; its tool list has no backtesting or chart rendering ([docs](https://www.tradingview.com/mcp/docs), checked Oct 2026).
2. **Morning market brief in one prompt.** Global market snapshot, futures overview, Bitcoin pulse and the Markets panel in a single answer.
3. **$9 all-in, nothing else to subscribe to.** TradingView's MCP is included only in paid TradingView plans, Essential and higher; trial plans don't include it ([docs](https://www.tradingview.com/mcp/docs), [pricing](https://www.tradingview.com/pricing/), checked Oct 2026). TradingMCP is $9/mo Pro or $29.99/mo Pro+ with a 14-day money-back guarantee, and self-hosting this repo stays free.

**Where TradingView's MCP wins:** fundamentals and analyst forecasts, SEC filings and earnings-call transcripts, editing your TradingView watchlists and alerts, and data that comes officially from TradingView itself ([docs](https://www.tradingview.com/mcp/docs), checked Oct 2026). If that is what you need, use theirs, or run both side by side.

[Try TradingMCP](https://tradingmcp.ai/?utm_source=github&utm_medium=readme&utm_content=vs_official) · works in Claude, ChatGPT, Cursor, Grok, Copilot or any MCP client.

</details>

---

## 🛠️ Troubleshooting

### 🪟 Windows: `MCP error -32001: Request timed out` on first launch

Python 3.14 is not supported yet: add `"--python", "3.13"` to the `uvx` args.

<details>
<summary>Symptom, cause and two fixes</summary>
<br>

Symptom — you see this in the Claude Desktop logs shortly after adding the config:

```
[tradingview] Server started and connected successfully
[tradingview] Message from client: initialize ...
[60 seconds later]
[tradingview] notifications/cancelled — reason: "MCP error -32001: Request timed out"
```

**Why it happens:** Python 3.14 is not supported yet. `uvx` downloads `tradingview-mcp-server`, creates a fresh virtualenv, and installs dependencies the first time it runs. Some native dependencies in the MCP stack do not currently publish compatible Python 3.14 wheels, so installation can fall back to source builds or fail before Claude Desktop finishes initializing the server.

**Fix — pin to Python 3.13 (has prebuilt pandas wheels):**

```json
{
  "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`.

**Alternative — pre-install once, then let Claude Desktop reuse the cache:**

```bash
# Run in a terminal before launching Claude Desktop
uv tool install --python 3.13 tradingview-mcp-server
```

After the install finishes, start Claude Desktop with the normal config and the server will come up instantly (cache is already warm).

> _Credit: [@wyh4444](https://github.com/wyh4444) for the original report in [#24](https://github.com/atilaahmettaner/tradingview-mcp/issues/24)._

</details>

---

## ⚠️ Error Envelope Format

Tools that have adopted the structured error format return either their normal payload **or** an error envelope, so a caller can tell "no matches today" from an upstream outage.

<details>
<summary>Envelope shape, which tools use it, and how to detect it</summary>
<br>

```json
{"error": {"code": "ALL_BATCHES_FAILED", "message": "All 5 batches failed; first error: JSONDecodeError(...)", "batches_attempted": 5, "batches_failed": 5, "first_error": "...", "retryable": true}}
```

**Why:** the previous `[]` / `{"error": "Analysis failed: ..."}` strings made it impossible to distinguish "no matches today" from "upstream rate-limit cliff." The new envelope is programmatically branchable by `code`, and `retryable` tells the caller whether waiting and retrying can help (upstream storms pass; a missing dependency won't fix itself).

**Coverage:** 28 of the 39 tools build their errors with the envelope helpers (some only on their main error paths). Not migrated yet: `market_sentiment`, `financial_news`, the three backtest tools, `yahoo_price`, `market_snapshot`, `bitcoin_market_pulse`, `stock_extended_hours`, `futures_category_snapshot` and `futures_watchlist`; tracked in [#76](https://github.com/atilaahmettaner/tradingview-mcp/issues/76).

**Detecting an error:**

```python
result = volume_breakout_scanner(exchange="KUCOIN")
if isinstance(result, dict) and "error" in result:
    code = result["error"]["code"]
    if result["error"].get("retryable"):
        # Wait + retry, raise alert, fall back to single-batch call, etc.
        ...
else:
    for row in result:
        ...
```

Stable codes are defined in [`core/errors.py`](https://github.com/atilaahmettaner/tradingview-mcp/blob/main/src/tradingview_mcp/core/errors.py).

</details>

---

## 📱 Use via Telegram, WhatsApp & More (OpenClaw)

Connect this server to **Telegram, WhatsApp, Discord** and 20+ messaging platforms using [OpenClaw](https://openclaw.ai) — a self-hosted AI gateway. **Tested & verified on Hetzner VPS (Ubuntu 24.04).**

👉 **[Full OpenClaw Setup Guide →](https://github.com/atilaahmettaner/tradingview-mcp/blob/main/OPENCLAW.md)**

<details>
<summary>Quick setup, model choice and common mistakes</summary>

### 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

```bash
# 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:

| Provider | Model ID for OpenClaw | Get Key |
|----------|----------------------|---------|
| **OpenRouter** (aggregator — access to all models) | `openrouter/google/gemini-3-flash-preview` | [openrouter.ai/keys](https://openrouter.ai/keys) |
| **Anthropic** (Claude direct) | `anthropic/claude-sonnet-4-5` | [console.anthropic.com](https://console.anthropic.com) |
| **Google** (Gemini direct) | `google/gemini-2.5-flash` | [aistudio.google.com](https://aistudio.google.com) |
| **OpenAI** (GPT direct) | `openai/gpt-4o-mini` | [platform.openai.com](https://platform.openai.com) |

```bash
# 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

| Symptom | Cause | Fix |
|---------|-------|-----|
| `Unrecognized keys: mcpServers` | `mcpServers` not supported in this version | Remove from config, use bash wrapper |
| `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 won't start | `gateway.mode` missing | `openclaw 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
```

</details>

---

## 🔧 All 39 MCP Tools

### 📊 Backtesting Engine

| Tool | Description |
|------|-------------|
| `backtest_strategy` | Backtest 1 of 9 strategies with institutional metrics (Sharpe, Calmar, Expectancy). Supports `1d` and `1h` timeframes; optional full trade log + equity curve. |
| `compare_strategies` | Run all 9 strategies on the same symbol and rank by performance. |
| `walk_forward_backtest_strategy` | Train/test split walk-forward validation with overfitting verdict (ROBUST / MODERATE / WEAK / OVERFITTED). |

**9 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)
- `rsi_pullback` — Dip-buy in confirmed uptrend (SMA50>SMA200 + RSI<40 entry)
- `keltner_breakout` — ATR-normalized breakout (EMA20 + 2·ATR upper band)
- `triple_ema` — EMA 20/50 cross gated by SMA200 trend filter

> `rsi_pullback`, `keltner_breakout` and `triple_ema` need `period='1y'` or `'2y'` so the SMA200 trend filter can complete its warmup.

**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 9 strategies on MSFT for 2 years"
→ #1 triple_ema:        +15.1% | Sharpe:  0.0 | WR: 100%
→ #2 keltner_breakout:  +14.3% | Sharpe:  4.7 | WR:  40%
→ #3 bollinger:         +12.2% | Sharpe:  4.1 | WR:  64%
→ Buy & Hold:            -2.1%
```

---

### 📈 Technical Analysis — One Symbol

| Tool | Description |
|------|-------------|
| `coin_analysis` | Full technical readout for one coin or stock on any supported exchange and timeframe. |
| `multi_timeframe_analysis` | Weekly → Daily → 4H → 1H → 15m trend alignment with one verdict. |
| `volume_confirmation_analysis` | Whether volume confirms the price move, for one symbol. |
| `smart_money_analysis` | Banker / hot-money accumulation read from price and volume history. |
| `multi_agent_analysis` | Three rule sets (trend & bands, momentum, volatility & structure) weigh one symbol and return BUY, SELL or HOLD with how strongly they agree. |

### 🔍 Scanners — Whole Exchange

| Tool | Description |
|------|-------------|
| `top_gainers` | Top gainers for an exchange and timeframe, with Bollinger Band context. |
| `top_losers` | Top losers for an exchange and timeframe. |
| `bollinger_scan` | Bollinger squeeze detection (low band width). |
| `rating_filter` | Filter by Bollinger Band rating, from −3 (strong sell) to +3 (strong buy). |
| `volume_breakout_scanner` | Volume spike together with a price breakout. |
| `smart_volume_scanner` | Volume, RSI and price change combined. |
| `consecutive_candles_scan` | Runs of consecutive growing or shrinking candles. |
| `advanced_candle_pattern` | Candle pattern analysis across timeframes. |

### 💰 Prices & Market Overview

| Tool | Description |
|------|-------------|
| `yahoo_price` | Quote from Yahoo Finance: price, change %, 52w high/low, market state |
| `market_snapshot` | Global overview: S&P500, NASDAQ, VIX, BTC, ETH, EUR/USD, SPY, GLD |
| `bitcoin_market_pulse` | BTC price, dominance, total crypto market cap and a risk read (CoinGecko). |
| `stock_extended_hours` | US pre-market and after-hours prices. |

**`yahoo_price` 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)

### 🌍 Global Stock Screener — Common & Preferred Shares

| Tool | Description |
|------|-------------|
| `stock_screener` | List common or preferred stocks for any TradingView country market (america, korea, germany, brazil, …) with price, currency, % change, dividend yield — ranked by market cap. The API twin of TradingView's "Common stock" / "Preferred stock" symbol-search filter. |
| `stock_prices` | Direct price lookup for specific symbols (comma-separated `EXCHANGE:SYMBOL`, e.g. `NASDAQ:NVDA, KRX:005930`) — price, currency, daily % change, with unrecognized tickers named in `not_found`. |

### 🧠 News & Sentiment (Marketaux)

| Tool | Description |
|------|-------------|
| `financial_news` | Latest financial headlines from Marketaux (licensed), optionally for one symbol. |
| `market_sentiment` | News sentiment for a stock or coin: bullish/bearish score and the articles behind it. |
| `combined_analysis` | **Power Tool**: technicals + news sentiment + headlines for one symbol, and whether they agree. |

Self-hosting? These three need a free `MARKETAUX_API_TOKEN` (see Quick Start).

### 📉 Futures

| Tool | Description |
|------|-------------|
| `futures_market_overview` | Most-traded futures contracts by volume (equity index, energy, metals, agriculture, rates, FX, crypto). |
| `futures_top_movers` | Futures contracts with the biggest moves today. |
| `futures_category_snapshot` | Quotes for the major front-month contracts in one category (e.g. ES1!, CL1!, GC1!). |
| `futures_watchlist` | The full categorized list of well-known front-month futures symbols. |

### 🧾 US Options

| Tool | Description |
|------|-------------|
| `stock_options_chain` | Full options chain (calls + puts) for a US stock and one expiry. |
| `stock_options_unusual_activity` | Strikes with unusual volume vs open interest, plus call vs put volume. |

### 🇪🇬 Egyptian Exchange (EGX)

| Tool | Description |
|------|-------------|
| `egx_market_overview` | Overview of the EGX market. |
| `egx_index_analysis` | One EGX index with constituent performance and indicators. |
| `egx_sector_scan` | EGX stocks by sector. |
| `egx_sector_scanner` | Sector rotation: hot and cold sectors with top picks. |
| `egx_stock_screener` | Ranks EGX stocks and finds actionable setups. |
| `egx_smart_money_scanner` | Ranks index constituents by smart-money accumulation. |
| `egx_trade_plan` | Full trade plan for one EGX stock. |
| `egx_fibonacci_retracement` | Fibonacci retracement levels for one EGX stock. |

---

### 🌍 Multi-Exchange Support

| Exchange | Tools |
|----------|-------|
| **Binance** | Crypto screener, all pairs |
| **KuCoin / Bybit+** | Crypto screener |
| **NASDAQ / NYSE** | US stocks (AAPL, TSLA, NVDA...) |
| **EGX (Egypt)** | 8 dedicated `egx_*` tools (above) |
| **Turkish (BIST)** | Via TradingView screener |
| **Europe & Canada** | Euronext (Paris, Amsterdam, Brussels, Lisbon), LSE, Xetra, Frankfurt, Milan, SIX, Madrid, TSX, TSX Venture |
| **India & Indonesia** | NSE, BSE (NIFTY, BANKNIFTY, SENSEX), IDX (Jakarta Composite) |

---

## 💬 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's the news sentiment on NVDA?"
AI: [market_sentiment] → Strongly Bullish (0.41) | 3 articles | 2 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 of the 9 strategies worked best on MSFT in the last 2 years?"
AI: [compare_strategies] → triple_ema #1 (+15.1%, WR 100%), keltner_breakout #2 (+14.3%), macd last (-23.4%)

You: "Run walk-forward backtest on supertrend for SPY"
AI: [walk_forward_backtest_strategy] → Verdict: ROBUST (avg robustness 0.92) | OOS return +8.5%

You: "Analyze TSLA with all signals: technical + sentiment + news"
AI: [combined_analysis] → Technical STRONG BUY confirmed by Bullish news sentiment (3 articles analyzed) | confidence HIGH
```

---

## 💖 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:

| Tier | Monthly | What You Get |
|------|---------|--------------|
| ☕ Coffee | $5 | Heartfelt gratitude + name in README |
| 🚀 Supporter | $15 | Above + priority bug fixes |
| 💎 Pro | $30 | Above + priority feature requests |

<a href="https://github.com/sponsors/atilaahmettaner">
  <img src="https://img.shields.io/badge/Become_a_Sponsor-pink?style=for-the-badge&logo=github-sponsors" alt="Sponsor"/>
</a>

---

## 📄 License

MIT License — see [LICENSE](https://github.com/atilaahmettaner/tradingview-mcp/blob/main/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.*

