# Tradingview Mcp (`deadheadt/tradingview-mcp`) Actor

Real-time TradingView market data via MCP. Screen stocks & crypto, technical analysis (RSI, MACD, BB, Ichimoku), Fibonacci levels, S/R zones, pivot points, VWAP, volume profile, earnings & IPO calendars, correlation. No API key needed.

- **URL**: https://apify.com/deadheadt/tradingview-mcp.md
- **Developed by:** [Brian johnson](https://apify.com/deadheadt) (community)
- **Categories:** MCP servers
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 light data reads

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## TradingView MCP Server

A [Model Context Protocol](https://modelcontextprotocol.io) server that exposes **41 TradingView market-data tools** to Claude and other AI agents — no rate limiting, no API key required.

### Project structure

````

tradingview-mcp/
├── mcp\_server.py                      # MCP server — 41 tools
├── tradingview\_historical\_fetcher.py  # Historical OHLCV helper
├── requirements.txt
└── README.md

````

### Quick start

```bash
pip install -r requirements.txt
python mcp_server.py
````

Add it to your Claude Code config (`.mcp.json`):

```json
{
  "tradingview": {
    "type": "stdio",
    "command": "python",
    "args": ["/path/to/mcp_server.py"]
  }
}
```

### Environment variables

Create a `.env` file for optional features:

```bash
## Required only for get_watchlist_tickers
## Copy from browser cookies while logged into tradingview.com
TV_SESSION_ID=your_sessionid_cookie
TV_SESSION_SIGN=your_sessionid_sign_cookie
```

### Available tools (41)

##### Screening & prices

| Tool | Description |
|------|-------------|
| `screen_stocks` | Bulk screener — filter by exchange, sector, price, market cap |
| `get_price` | Current price for a single ticker |
| `get_multiple_prices` | Prices for up to 100 tickers in one call |
| `top_gainers` / `top_losers` | Biggest movers for the day |
| `rating_filter` | Screen by TV recommendation (Buy/Sell/Neutral) |
| `search_symbol` | Search for a ticker by name or keyword |
| `get_symbol_info` | Company description, sector, country, exchange |

##### Technical indicators

| Tool | Description |
|------|-------------|
| `get_technical_analysis` | Full TA summary (RSI, MACD, MAs, oscillators, signal) |
| `coin_analysis` | Same as above, optimised for crypto |
| `get_bollinger_bands` | BB upper/middle/lower, width, %B, squeeze flag |
| `get_macd` | MACD line, signal, histogram |
| `get_moving_averages` | SMA/EMA across 5, 10, 20, 50, 100, 200 periods |
| `get_stochastic` | %K, %D, crossover signal |
| `get_adx` | ADX, +DI, -DI, trend strength |
| `get_ichimoku_cloud` | Tenkan, Kijun, Senkou A/B, Chikou |
| `get_atr` | Average True Range |
| `get_vwap` | Volume-Weighted Average Price |

##### Chart patterns & structure

| Tool | Description |
|------|-------------|
| `get_fibonacci_retracement` | Fib levels from swing high/low |
| `get_support_resistance` | Key S/R levels via pivot clustering |
| `get_pivot_points` | Classic, Camarilla, Woodie pivots |
| `get_volume_profile` | Volume by price bucket (POC, VAH, VAL) |
| `detect_unfilled_gaps` | Open price gaps on the chart |
| `consecutive_candles_scan` | Scan for N consecutive bullish/bearish candles |
| `advanced_candle_pattern` | Doji, engulfing, hammer, shooting star, etc. |
| `bollinger_scan` | Screen stocks near BB extremes |

##### Historical data & correlation

| Tool | Description |
|------|-------------|
| `get_historical_ohlcv` | OHLCV candles (1m → 1M) |
| `calculate_correlation` | Pearson correlation between two symbols |
| `list_available_pairs` | Browse forex pairs by base/quote currency |

##### Options & volatility

| Tool | Description |
|------|-------------|
| `get_iv_smile` | Implied-volatility smile by strike or delta for a specific expiry |
| `get_iv_term_structure` | IV at standard tenors (1w/2w/1m/2m/3m/6m/9m/1y) and real expiries |

##### Watchlists

| Tool | Description |
|------|-------------|
| `get_watchlist_data` | Performance, volatility, RSI, rating for an explicit ticker list |
| `get_watchlist_tickers` | Fetch tickers from a TradingView watchlist by its numeric ID |

##### Calendars & bonds

| Tool | Description |
|------|-------------|
| `get_earnings_calendar` | Upcoming earnings dates and EPS estimates |
| `get_ipo_calendar` | Scheduled IPOs |
| `get_bond_info` | Corporate bonds related to a stock (yield, maturity) |

##### News

| Tool | Description |
|------|-------------|
| `get_symbol_news` | Latest news articles for a ticker with cursor pagination |

##### Backtesting

| Tool | Description |
|------|-------------|
| `backtest_indicator` | Run a single strategy on a symbol and get P\&L metrics |
| `backtest_optimize` | Grid-search indicator parameters for best return |
| `backtest_compare` | Compare strategies across multiple symbols |

##### Portfolio

| Tool | Description |
|------|-------------|
| `get_portfolio_stocks` | Read a local SQLite portfolio database |

### Tech stack

- Python 3.9+, [FastMCP](https://github.com/jlowin/fastmcp)
- TradingView public APIs (scanner, options-charting, news-mediator)
- Pandas, NumPy (backtesting engine)

### Disclaimer

For educational and informational purposes only. Not financial advice.

## Actor input object example

```json
{}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("deadheadt/tradingview-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("deadheadt/tradingview-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call deadheadt/tradingview-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=deadheadt/tradingview-mcp",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Tradingview Mcp",
        "description": "Real-time TradingView market data via MCP. Screen stocks & crypto, technical analysis (RSI, MACD, BB, Ichimoku), Fibonacci levels, S/R zones, pivot points, VWAP, volume profile, earnings & IPO calendars, correlation. No API key needed.",
        "version": "0.0",
        "x-build-id": "2nzZib7ZyK8GqbovY"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/deadheadt~tradingview-mcp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-deadheadt-tradingview-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/deadheadt~tradingview-mcp/runs": {
            "post": {
                "operationId": "runs-sync-deadheadt-tradingview-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/deadheadt~tradingview-mcp/run-sync": {
            "post": {
                "operationId": "run-sync-deadheadt-tradingview-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {}
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
