tradingview-mcp-server 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +259 -308
- package/dist/index.js +212 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/presets.d.ts +2 -1
- package/dist/resources/presets.d.ts.map +1 -1
- package/dist/resources/presets.js +42 -1
- package/dist/resources/presets.js.map +1 -1
- package/dist/tests/fields.test.js +224 -0
- package/dist/tests/fields.test.js.map +1 -1
- package/dist/tests/lookup.test.d.ts +2 -0
- package/dist/tests/lookup.test.d.ts.map +1 -0
- package/dist/tests/lookup.test.js +303 -0
- package/dist/tests/lookup.test.js.map +1 -0
- package/dist/tests/presets.test.js +8 -1
- package/dist/tests/presets.test.js.map +1 -1
- package/dist/tests/screen.test.d.ts +2 -0
- package/dist/tests/screen.test.d.ts.map +1 -0
- package/dist/tests/screen.test.js +378 -0
- package/dist/tests/screen.test.js.map +1 -0
- package/dist/tools/fields.d.ts.map +1 -1
- package/dist/tools/fields.js +119 -0
- package/dist/tools/fields.js.map +1 -1
- package/dist/tools/screen.d.ts +10 -0
- package/dist/tools/screen.d.ts.map +1 -1
- package/dist/tools/screen.js +176 -35
- package/dist/tools/screen.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,34 +12,70 @@
|
|
|
12
12
|
|
|
13
13
|
**Unofficial** Model Context Protocol (MCP) server for TradingView's stock screener API.
|
|
14
14
|
|
|
15
|
+
### AI-powered investment research for patient, systematic investors.
|
|
16
|
+
|
|
15
17
|
</div>
|
|
16
18
|
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🎯 Why Use This Tool?
|
|
22
|
+
|
|
23
|
+
This tool is designed for **curious investors** who want to explore beyond passive index investing without the complexity and competition of day trading.
|
|
24
|
+
|
|
25
|
+
### The Investment Sweet Spot
|
|
26
|
+
|
|
27
|
+
**Not for day trading** 📉
|
|
28
|
+
Individual traders can't compete with hedge funds, HFT algorithms, and institutional systems operating at millisecond speeds. Day trading is a zero-sum game dominated by professionals with superior technology and information.
|
|
29
|
+
|
|
30
|
+
**Not for passive index investing** 📊
|
|
31
|
+
If you're content with market returns through index funds (S&P 500, total market ETFs), that's excellent - but you don't need screening tools. Just buy and hold.
|
|
32
|
+
|
|
33
|
+
**Perfect for systematic, research-driven investing** 🔍
|
|
34
|
+
This tool is for investors who:
|
|
35
|
+
- Want to **explore higher alpha strategies** than passive investing
|
|
36
|
+
- Are **curious to learn** different investment approaches (value, growth, quality, momentum)
|
|
37
|
+
- Seek **better risk-adjusted returns** through systematic stock selection
|
|
38
|
+
- Prefer **multi-month to multi-year investment horizons** without intraday stress
|
|
39
|
+
- Want to **test investment hypotheses** using fundamental and technical data
|
|
40
|
+
- Value **systematic screening** over gut feelings and tips
|
|
41
|
+
|
|
42
|
+
### Your Edge: Time, Research, and Patience
|
|
43
|
+
|
|
44
|
+
Unlike hedge funds competing on speed and information access, you can compete on:
|
|
45
|
+
- **Patience** - Hold positions through volatility without quarterly reporting pressure
|
|
46
|
+
- **Research depth** - Screen comprehensively with 75+ fundamental and technical fields
|
|
47
|
+
- **Strategy experimentation** - Test different approaches (quality, value, growth, momentum)
|
|
48
|
+
- **Risk management** - Build diversified portfolios with systematic criteria
|
|
49
|
+
|
|
50
|
+
**This tool helps you find opportunities, understand metrics, and make informed decisions - not chase minute-by-minute price movements.**
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
17
54
|
## Table of Contents
|
|
18
55
|
|
|
19
56
|
- [Features](#features)
|
|
20
57
|
- [Installation](#installation)
|
|
21
58
|
- [Configuration](#configuration)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- [Usage Examples](#usage-examples)
|
|
59
|
+
- [Try It Out: Included Commands](#try-it-out-included-commands)
|
|
60
|
+
- [Quick Start](#quick-start)
|
|
61
|
+
- [Documentation](#documentation)
|
|
26
62
|
- [Available Tools](#available-tools)
|
|
27
|
-
- [Preset Strategies](#preset-strategies)
|
|
28
|
-
- [Common Fields](#common-fields)
|
|
29
|
-
- [Field Variants (TTM vs FQ vs FY)](#field-variants-ttm-vs-fq-vs-fy)
|
|
30
|
-
- [Development](#development)
|
|
31
63
|
- [Important Notes](#important-notes)
|
|
32
64
|
- [Contributing](#contributing)
|
|
33
65
|
- [License](#license)
|
|
34
66
|
|
|
35
67
|
## Features
|
|
36
68
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
69
|
+
**Built for research-driven investment discovery:**
|
|
70
|
+
|
|
71
|
+
- 🔍 **Multi-asset screening** - Dedicated tools for stocks, forex, crypto, and ETFs with advanced filters
|
|
72
|
+
- 📊 **75+ investment metrics** - Fundamental (valuation, margins, returns), technical (RSI, moving averages), and performance fields with TTM/FQ/FY variants
|
|
73
|
+
- 🎯 **7 proven strategies & presets** - Pre-configured screens for quality, value, dividend, momentum, growth investing, plus global market indexes
|
|
74
|
+
- 💡 **AI-powered exploration** - Natural language queries through Claude ("Find undervalued companies with strong balance sheets")
|
|
75
|
+
- 💰 **Deep financial analysis** - EV, EV/EBIT, EV/EBITDA, PEG, gross/operating margins, ROIC, ROA, ROE
|
|
76
|
+
- ⚡ **Research-optimized** - Minimal (7 fields) for quick scans vs extended (35 fields) for comprehensive analysis
|
|
77
|
+
- 🏦 **Exchange filtering** - Focus on NASDAQ, NYSE, CBOE, or primary listings only
|
|
78
|
+
- 🌍 **Global coverage** - Screen stocks across multiple markets (America, Europe, Asia) and 9,000+ cryptocurrencies
|
|
43
79
|
|
|
44
80
|
## Installation
|
|
45
81
|
|
|
@@ -49,41 +85,38 @@
|
|
|
49
85
|
npm install -g tradingview-mcp-server
|
|
50
86
|
```
|
|
51
87
|
|
|
52
|
-
### Option 2:
|
|
88
|
+
### Option 2: Clone Repository (with demo commands)
|
|
53
89
|
|
|
54
90
|
```bash
|
|
55
91
|
git clone https://github.com/fiale-plus/tradingview-mcp-server.git
|
|
56
92
|
cd tradingview-mcp-server
|
|
57
93
|
npm install
|
|
58
|
-
|
|
94
|
+
|
|
95
|
+
# Quick setup - creates project-level MCP config
|
|
96
|
+
./local-setup.sh # Linux/Mac
|
|
97
|
+
local-setup.bat # Windows
|
|
98
|
+
|
|
99
|
+
# Restart Claude Code and try: /market-regime or /run-screener
|
|
59
100
|
```
|
|
60
101
|
|
|
61
102
|
## Configuration
|
|
62
103
|
|
|
63
104
|
### Claude Desktop
|
|
64
105
|
|
|
65
|
-
Add to your Claude
|
|
66
|
-
|
|
67
|
-
**Mac**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
68
|
-
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
69
|
-
**Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
106
|
+
Add to your Claude config file (`~/Library/Application Support/Claude/claude_desktop_config.json` on Mac):
|
|
70
107
|
|
|
71
108
|
```json
|
|
72
109
|
{
|
|
73
110
|
"mcpServers": {
|
|
74
111
|
"tradingview": {
|
|
75
112
|
"command": "npx",
|
|
76
|
-
"args": ["-y", "tradingview-mcp-server"]
|
|
77
|
-
"env": {
|
|
78
|
-
"CACHE_TTL_SECONDS": "300",
|
|
79
|
-
"RATE_LIMIT_RPM": "10"
|
|
80
|
-
}
|
|
113
|
+
"args": ["-y", "tradingview-mcp-server"]
|
|
81
114
|
}
|
|
82
115
|
}
|
|
83
116
|
}
|
|
84
117
|
```
|
|
85
118
|
|
|
86
|
-
### Claude Code
|
|
119
|
+
### Claude Code
|
|
87
120
|
|
|
88
121
|
Create `.mcp.json` in your project root:
|
|
89
122
|
|
|
@@ -92,11 +125,7 @@ Create `.mcp.json` in your project root:
|
|
|
92
125
|
"mcpServers": {
|
|
93
126
|
"tradingview": {
|
|
94
127
|
"command": "npx",
|
|
95
|
-
"args": ["-y", "tradingview-mcp-server"]
|
|
96
|
-
"env": {
|
|
97
|
-
"CACHE_TTL_SECONDS": "300",
|
|
98
|
-
"RATE_LIMIT_RPM": "10"
|
|
99
|
-
}
|
|
128
|
+
"args": ["-y", "tradingview-mcp-server"]
|
|
100
129
|
}
|
|
101
130
|
}
|
|
102
131
|
}
|
|
@@ -110,58 +139,124 @@ Enable in `.claude/settings.local.json`:
|
|
|
110
139
|
}
|
|
111
140
|
```
|
|
112
141
|
|
|
113
|
-
|
|
142
|
+
**Optional environment variables:**
|
|
143
|
+
- `CACHE_TTL_SECONDS` - Cache duration (default: 300)
|
|
144
|
+
- `RATE_LIMIT_RPM` - Requests per minute (default: 10)
|
|
114
145
|
|
|
115
|
-
|
|
116
|
-
|----------|-------------|---------|
|
|
117
|
-
| `CACHE_TTL_SECONDS` | Cache time-to-live in seconds (0 to disable) | `300` (5 min) |
|
|
118
|
-
| `RATE_LIMIT_RPM` | API requests per minute | `10` |
|
|
146
|
+
## Try It Out: Included Commands
|
|
119
147
|
|
|
120
|
-
|
|
148
|
+
The repository includes two ready-to-use Claude Code commands that demonstrate practical workflows:
|
|
121
149
|
|
|
122
|
-
###
|
|
150
|
+
### `/market-regime` - Check Market Health
|
|
123
151
|
|
|
152
|
+
Quickly assess overall market conditions by analyzing major indexes relative to their all-time highs.
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# In Claude Code, run:
|
|
156
|
+
/market-regime
|
|
124
157
|
```
|
|
125
|
-
|
|
158
|
+
|
|
159
|
+
**What you get:**
|
|
160
|
+
- Color-coded status table (🟢/🟡/🔴) for Nasdaq, OMX Stockholm 30, and Nikkei 225
|
|
161
|
+
- Drawdown calculations from all-time highs
|
|
162
|
+
- Market regime summary (bull/correction/bear)
|
|
163
|
+
- Use before making new allocations or for weekly portfolio reviews
|
|
164
|
+
|
|
165
|
+
### `/run-screener` - Interactive Stock Screening
|
|
166
|
+
|
|
167
|
+
Run pre-configured screening strategies and save results to CSV for further analysis.
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# In Claude Code, run:
|
|
171
|
+
/run-screener
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**What you get:**
|
|
175
|
+
- Interactive preset selection (quality, value, dividend, momentum, growth)
|
|
176
|
+
- Summary table of top results with key metrics
|
|
177
|
+
- Complete results saved to `docs/local/screening-runs/{preset}_{timestamp}.csv`
|
|
178
|
+
- Perfect for building watchlists and learning different investment styles
|
|
179
|
+
|
|
180
|
+
**First-time setup:**
|
|
181
|
+
```bash
|
|
182
|
+
# Quick setup script (recommended)
|
|
183
|
+
./local-setup.sh # Linux/Mac
|
|
184
|
+
local-setup.bat # Windows
|
|
185
|
+
|
|
186
|
+
# Or manually copy files:
|
|
187
|
+
cp .mcp.json.example .mcp.json
|
|
188
|
+
cp .claude/settings.json.example .claude/settings.local.json
|
|
189
|
+
|
|
190
|
+
# Restart Claude Code to load MCP server and commands
|
|
126
191
|
```
|
|
127
192
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
193
|
+
See [`.claude/commands/README.md`](.claude/commands/README.md) for detailed command documentation.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Quick Start
|
|
198
|
+
|
|
199
|
+
### Learning Investment Strategies
|
|
200
|
+
|
|
201
|
+
Explore proven investment approaches with pre-configured strategies:
|
|
134
202
|
|
|
135
|
-
|
|
203
|
+
```
|
|
204
|
+
I want to learn about quality investing - show me quality stocks
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
Find dividend stocks that could provide steady income
|
|
209
|
+
```
|
|
136
210
|
|
|
137
211
|
```
|
|
138
|
-
Screen for
|
|
139
|
-
- ROE greater than 15%
|
|
140
|
-
- P/E ratio less than 25
|
|
141
|
-
- Market cap above $1 billion
|
|
142
|
-
- Limit to 10 results
|
|
212
|
+
What makes a good value investment? Screen for undervalued companies
|
|
143
213
|
```
|
|
144
214
|
|
|
145
|
-
###
|
|
215
|
+
### Research-Driven Stock Selection
|
|
216
|
+
|
|
217
|
+
Build your investment thesis systematically:
|
|
146
218
|
|
|
147
219
|
```
|
|
148
|
-
|
|
220
|
+
Find companies with:
|
|
221
|
+
- Strong return on equity (>15%)
|
|
222
|
+
- Reasonable valuation (P/E < 25)
|
|
223
|
+
- Significant scale (market cap > $1B)
|
|
224
|
+
- Low debt levels
|
|
149
225
|
```
|
|
150
226
|
|
|
151
|
-
|
|
227
|
+
```
|
|
228
|
+
I'm interested in profitable companies trading below their intrinsic value.
|
|
229
|
+
Screen for stocks with EV/EBITDA < 10 and positive free cash flow.
|
|
230
|
+
```
|
|
152
231
|
|
|
153
|
-
###
|
|
232
|
+
### Understanding Investment Metrics
|
|
154
233
|
|
|
155
234
|
```
|
|
156
|
-
|
|
235
|
+
What financial metrics can I use for fundamental analysis?
|
|
157
236
|
```
|
|
158
237
|
|
|
159
|
-
|
|
238
|
+
```
|
|
239
|
+
Explain the difference between P/E ratio and PEG ratio
|
|
240
|
+
```
|
|
160
241
|
|
|
161
242
|
```
|
|
162
|
-
|
|
243
|
+
What's the difference between gross margin and operating margin?
|
|
163
244
|
```
|
|
164
245
|
|
|
246
|
+
## Documentation
|
|
247
|
+
|
|
248
|
+
### 📚 Comprehensive Guides
|
|
249
|
+
|
|
250
|
+
- **[Preset Strategies](docs/presets.md)** - All 7 preset strategies with detailed criteria, use cases, and examples
|
|
251
|
+
- **[Field Reference](docs/fields.md)** - Complete guide to all 75+ fields with descriptions and usage examples
|
|
252
|
+
- **[Development Guide](docs/development.md)** - Local setup, testing, and extending the server
|
|
253
|
+
|
|
254
|
+
### 🔧 Advanced Topics
|
|
255
|
+
|
|
256
|
+
- **[Field Variants (TTM/FQ/FY)](docs/fields.md#understanding-field-variants)** - Understanding time periods
|
|
257
|
+
- **[Column Optimization](docs/presets.md#performance-characteristics)** - Minimal vs extended column sets
|
|
258
|
+
- **[Custom Presets](docs/development.md#creating-new-presets)** - Creating your own screening strategies
|
|
259
|
+
|
|
165
260
|
## Available Tools
|
|
166
261
|
|
|
167
262
|
### `screen_stocks`
|
|
@@ -174,6 +269,7 @@ Screen stocks based on filters.
|
|
|
174
269
|
- `sort_by` - Field to sort by (default: `"market_cap_basic"`)
|
|
175
270
|
- `sort_order` - `"asc"` or `"desc"` (default: `"desc"`)
|
|
176
271
|
- `limit` - Number of results (1-200, default: 20)
|
|
272
|
+
- `columns` - Optional array of columns to return (default: minimal 7 fields for performance)
|
|
177
273
|
|
|
178
274
|
**Operators:**
|
|
179
275
|
- `greater`, `less`, `greater_or_equal`, `less_or_equal`
|
|
@@ -194,282 +290,108 @@ List available fields for filtering.
|
|
|
194
290
|
Get a pre-configured screening strategy.
|
|
195
291
|
|
|
196
292
|
**Available Presets:**
|
|
197
|
-
- `quality_stocks` - Conservative quality
|
|
198
|
-
- `value_stocks` - Undervalued
|
|
199
|
-
- `dividend_stocks` - High
|
|
200
|
-
- `momentum_stocks` -
|
|
201
|
-
- `growth_stocks` - High
|
|
202
|
-
- `quality_growth_screener` - Comprehensive 16-filter
|
|
293
|
+
- `quality_stocks` - Conservative quality (ROE >12%, low debt, low volatility)
|
|
294
|
+
- `value_stocks` - Undervalued (P/E <15, P/B <1.5)
|
|
295
|
+
- `dividend_stocks` - High yield (>3%, low debt)
|
|
296
|
+
- `momentum_stocks` - Technical strength (RSI 50-70, golden cross)
|
|
297
|
+
- `growth_stocks` - High growth (ROE >20%, margins >15%)
|
|
298
|
+
- `quality_growth_screener` - Comprehensive 16-filter screen with 35 extended columns
|
|
299
|
+
|
|
300
|
+
See **[Preset Strategies Guide](docs/presets.md)** for detailed criteria and usage.
|
|
203
301
|
|
|
204
302
|
### `list_presets`
|
|
205
303
|
|
|
206
304
|
List all available preset strategies.
|
|
207
305
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
The server includes 6 pre-configured screening strategies optimized for different investment styles:
|
|
211
|
-
|
|
212
|
-
### Quality Stocks (Conservative)
|
|
213
|
-
**Preset:** `quality_stocks`
|
|
214
|
-
|
|
215
|
-
High-quality, low-volatility stocks with strong fundamentals and uptrends. Based on Avanza's conservative screening strategy.
|
|
216
|
-
|
|
217
|
-
**Criteria:**
|
|
218
|
-
- ROE > 12%
|
|
219
|
-
- Market cap > $200M
|
|
220
|
-
- P/E < 40
|
|
221
|
-
- P/S < 8
|
|
222
|
-
- Debt/Equity < 0.7
|
|
223
|
-
- Net margin > 10%
|
|
224
|
-
- RSI between 45-65
|
|
225
|
-
- Monthly volatility ≤ 3%
|
|
226
|
-
- Golden cross (SMA50 > SMA200)
|
|
227
|
-
|
|
228
|
-
### Value Stocks
|
|
229
|
-
**Preset:** `value_stocks`
|
|
230
|
-
|
|
231
|
-
Undervalued stocks trading below intrinsic value with solid fundamentals.
|
|
232
|
-
|
|
233
|
-
**Criteria:**
|
|
234
|
-
- P/E < 15
|
|
235
|
-
- P/B < 1.5
|
|
236
|
-
- Market cap > $1B
|
|
237
|
-
- ROE > 10%
|
|
238
|
-
|
|
239
|
-
### Dividend Stocks
|
|
240
|
-
**Preset:** `dividend_stocks`
|
|
241
|
-
|
|
242
|
-
Income-focused stocks with high dividend yields and financial stability.
|
|
243
|
-
|
|
244
|
-
**Criteria:**
|
|
245
|
-
- Dividend yield > 3%
|
|
246
|
-
- Market cap > $5B
|
|
247
|
-
- Debt/Equity < 1.0
|
|
248
|
-
|
|
249
|
-
### Momentum Stocks
|
|
250
|
-
**Preset:** `momentum_stocks`
|
|
251
|
-
|
|
252
|
-
Stocks showing strong technical momentum and recent performance.
|
|
253
|
-
|
|
254
|
-
**Criteria:**
|
|
255
|
-
- RSI between 50-70
|
|
256
|
-
- SMA50 > SMA200 (golden cross)
|
|
257
|
-
- 1-month performance > 5%
|
|
258
|
-
- Volume > 1M shares
|
|
259
|
-
|
|
260
|
-
### Growth Stocks
|
|
261
|
-
**Preset:** `growth_stocks`
|
|
262
|
-
|
|
263
|
-
High-growth companies with strong profitability and margins.
|
|
264
|
-
|
|
265
|
-
**Criteria:**
|
|
266
|
-
- ROE > 20%
|
|
267
|
-
- Operating margin > 15%
|
|
268
|
-
- Market cap > $1B
|
|
269
|
-
|
|
270
|
-
### Quality Growth Screener (Comprehensive)
|
|
271
|
-
**Preset:** `quality_growth_screener`
|
|
272
|
-
|
|
273
|
-
Comprehensive quality and growth screen combining fundamental strength, growth momentum, financial stability, and technical uptrend. Primary listings only on major US exchanges.
|
|
274
|
-
|
|
275
|
-
**16-Filter Criteria:**
|
|
276
|
-
|
|
277
|
-
**Price & Size:**
|
|
278
|
-
- Price ≥ $10
|
|
279
|
-
- Market cap ≥ $2B
|
|
306
|
+
### `screen_forex`
|
|
280
307
|
|
|
281
|
-
|
|
282
|
-
- P/E (TTM) ≤ 35
|
|
283
|
-
- P/S (Current) ≤ 6
|
|
308
|
+
Screen forex pairs based on technical criteria.
|
|
284
309
|
|
|
285
|
-
**
|
|
286
|
-
-
|
|
287
|
-
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
- Debt/Equity (FY) < 0.6
|
|
291
|
-
|
|
292
|
-
**Growth:**
|
|
293
|
-
- Revenue/Share (TTM) > $3
|
|
294
|
-
- Revenue Growth YoY > 8%
|
|
310
|
+
**Parameters:**
|
|
311
|
+
- `filters` - Array of filter conditions (field, operator, value)
|
|
312
|
+
- `sort_by` - Field to sort by (default: `"volume"`)
|
|
313
|
+
- `sort_order` - `"asc"` or `"desc"` (default: `"desc"`)
|
|
314
|
+
- `limit` - Number of results (1-200, default: 20)
|
|
295
315
|
|
|
296
|
-
**
|
|
297
|
-
- RSI between 45-62
|
|
298
|
-
- Golden cross (SMA50 ≥ SMA200)
|
|
299
|
-
- Price > SMA50 (above trend)
|
|
300
|
-
- Monthly volatility < 3%
|
|
316
|
+
**Example fields:** `close`, `volume`, `change`, `RSI`, `SMA50`, `SMA200`, `Volatility.M`
|
|
301
317
|
|
|
302
|
-
|
|
303
|
-
- 90-day avg volume > 200K
|
|
304
|
-
- Exchange: NASDAQ, NYSE, or CBOE only
|
|
305
|
-
- Primary listing only (eliminates duplicates)
|
|
318
|
+
### `screen_crypto`
|
|
306
319
|
|
|
307
|
-
|
|
320
|
+
Screen cryptocurrencies based on technical and market criteria.
|
|
308
321
|
|
|
309
|
-
|
|
310
|
-
- `
|
|
311
|
-
- `
|
|
312
|
-
- `
|
|
313
|
-
- `
|
|
314
|
-
- `net_margin_ttm` - Net Margin (%)
|
|
315
|
-
- `market_cap_basic` - Market Capitalization
|
|
316
|
-
- `dividend_yield_recent` - Dividend Yield (%)
|
|
317
|
-
|
|
318
|
-
### Technical
|
|
319
|
-
- `RSI` - Relative Strength Index (14)
|
|
320
|
-
- `SMA50` - 50-day Simple Moving Average
|
|
321
|
-
- `SMA200` - 200-day Simple Moving Average
|
|
322
|
-
- `Volatility.M` - Monthly Volatility (%)
|
|
322
|
+
**Parameters:**
|
|
323
|
+
- `filters` - Array of filter conditions (field, operator, value)
|
|
324
|
+
- `sort_by` - Field to sort by (default: `"market_cap_basic"`)
|
|
325
|
+
- `sort_order` - `"asc"` or `"desc"` (default: `"desc"`)
|
|
326
|
+
- `limit` - Number of results (1-200, default: 20)
|
|
323
327
|
|
|
324
|
-
|
|
325
|
-
- `close` - Current Price
|
|
326
|
-
- `change` - Daily Change (%)
|
|
327
|
-
- `volume` - Trading Volume
|
|
328
|
-
- `average_volume_90d_calc` - 90-day Average Volume
|
|
329
|
-
- `Perf.W`, `Perf.1M`, `Perf.Y` - Performance metrics
|
|
330
|
-
- `exchange` - Stock exchange (NASDAQ, NYSE, CBOE)
|
|
331
|
-
- `is_primary` - Primary listing indicator
|
|
328
|
+
**Example fields:** `close`, `market_cap_basic`, `volume`, `change`, `Perf.1M`, `Perf.3M`, `Perf.Y`
|
|
332
329
|
|
|
333
|
-
|
|
330
|
+
### `screen_etf`
|
|
334
331
|
|
|
335
|
-
|
|
332
|
+
Screen ETFs (Exchange-Traded Funds) based on performance and technical criteria.
|
|
336
333
|
|
|
337
|
-
|
|
334
|
+
**Parameters:**
|
|
335
|
+
- `filters` - Array of filter conditions (field, operator, value)
|
|
336
|
+
- `markets` - Markets to scan (default: `["america"]`)
|
|
337
|
+
- `sort_by` - Field to sort by (default: `"market_cap_basic"`)
|
|
338
|
+
- `sort_order` - `"asc"` or `"desc"` (default: `"desc"`)
|
|
339
|
+
- `limit` - Number of results (1-200, default: 20)
|
|
340
|
+
- `columns` - Optional array of columns to return
|
|
338
341
|
|
|
339
|
-
|
|
340
|
-
- Most recent, updates quarterly
|
|
341
|
-
- Example: `return_on_equity`, `price_earnings_ttm`, `net_margin_ttm`
|
|
342
|
+
**Example fields:** `close`, `volume`, `change`, `Perf.1M`, `Perf.Y`, `RSI`, `beta_1_year`
|
|
342
343
|
|
|
343
|
-
|
|
344
|
-
- Updates quarterly
|
|
345
|
-
- More volatile than TTM
|
|
346
|
-
- Example: `return_on_equity_fq`, `price_book_fq`
|
|
344
|
+
### `lookup_symbols`
|
|
347
345
|
|
|
348
|
-
|
|
349
|
-
- Updates annually
|
|
350
|
-
- Most stable, less frequent updates
|
|
351
|
-
- Example: `debt_to_equity_fy`, `net_margin_fy`
|
|
346
|
+
Look up specific symbols (stocks, indexes, ETFs) by ticker. **Use this for market indexes** like TVC:SPX, TVC:DJI, OMXSTO:OMXS30 that cannot be found via screening.
|
|
352
347
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|-------------|-----|----|----|
|
|
357
|
-
| Return on Equity | `return_on_equity` | `return_on_equity_fq` | - |
|
|
358
|
-
| Net Margin | `net_margin_ttm` | - | `net_margin_fy` |
|
|
359
|
-
| Debt/Equity | `debt_to_equity` | - | `debt_to_equity_fy` |
|
|
360
|
-
| Price/Sales | `price_sales_ratio` | - | `price_sales_current` |
|
|
348
|
+
**Parameters:**
|
|
349
|
+
- `symbols` - Array of ticker symbols (e.g., `["TVC:SPX", "NASDAQ:AAPL", "OMXSTO:OMXS30"]`). Maximum 100 symbols.
|
|
350
|
+
- `columns` - Optional array of columns to include
|
|
361
351
|
|
|
362
|
-
|
|
352
|
+
**Default columns:** `name`, `close`, `change`, `volume`, `market_cap_basic`, `all_time_high`, `all_time_low`, `price_52_week_high`, `price_52_week_low`
|
|
363
353
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
354
|
+
**Use Cases:**
|
|
355
|
+
- **Market regime analysis** - Check if indexes are at all-time highs
|
|
356
|
+
- **Direct symbol lookup** - Faster than screening for known tickers
|
|
357
|
+
- **Portfolio comparison** - Compare your holdings side-by-side
|
|
358
|
+
- **Benchmark analysis** - Compare against market indexes
|
|
368
359
|
|
|
369
|
-
Example
|
|
360
|
+
**Example:** Get S&P 500, Nasdaq, and OMX Stockholm 30 with market regime data
|
|
370
361
|
```javascript
|
|
371
|
-
{
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
{ field: "net_margin_fy", operator: "greater", value: 12 }
|
|
376
|
-
]
|
|
377
|
-
}
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
## Resources
|
|
381
|
-
|
|
382
|
-
The server exposes preset configurations as MCP resources:
|
|
383
|
-
|
|
384
|
-
- `preset://quality_stocks`
|
|
385
|
-
- `preset://value_stocks`
|
|
386
|
-
- `preset://dividend_stocks`
|
|
387
|
-
- `preset://momentum_stocks`
|
|
388
|
-
- `preset://growth_stocks`
|
|
389
|
-
- `preset://quality_growth_screener`
|
|
390
|
-
|
|
391
|
-
## Development
|
|
392
|
-
|
|
393
|
-
### Local Setup
|
|
394
|
-
|
|
395
|
-
```bash
|
|
396
|
-
# Clone the repository
|
|
397
|
-
git clone https://github.com/fiale-plus/tradingview-mcp-server.git
|
|
398
|
-
cd tradingview-mcp-server
|
|
399
|
-
|
|
400
|
-
# Install dependencies
|
|
401
|
-
npm install
|
|
402
|
-
|
|
403
|
-
# Build
|
|
404
|
-
npm run build
|
|
405
|
-
|
|
406
|
-
# Run tests
|
|
407
|
-
npm test
|
|
408
|
-
|
|
409
|
-
# Watch tests
|
|
410
|
-
npm test:watch
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
### Using Local MCP Server with Claude
|
|
414
|
-
|
|
415
|
-
To test your local development build with Claude Desktop or Claude Code:
|
|
416
|
-
|
|
417
|
-
#### Option 1: Project-Level MCP (Recommended for Development)
|
|
418
|
-
|
|
419
|
-
Create `.mcp.json` in your project root:
|
|
420
|
-
|
|
421
|
-
```json
|
|
422
|
-
{
|
|
423
|
-
"mcpServers": {
|
|
424
|
-
"tradingview-local": {
|
|
425
|
-
"command": "node",
|
|
426
|
-
"args": ["/absolute/path/to/tradingview-mcp-server/dist/index.js"],
|
|
427
|
-
"env": {
|
|
428
|
-
"CACHE_TTL_SECONDS": "300",
|
|
429
|
-
"RATE_LIMIT_RPM": "10"
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
362
|
+
lookup_symbols({
|
|
363
|
+
symbols: ["TVC:SPX", "TVC:IXIC", "OMXSTO:OMXS30"],
|
|
364
|
+
columns: ["close", "all_time_high", "price_52_week_high", "Perf.Y", "RSI"]
|
|
365
|
+
})
|
|
434
366
|
```
|
|
435
367
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
```json
|
|
439
|
-
{
|
|
440
|
-
"enableAllProjectMcpServers": true
|
|
441
|
-
}
|
|
442
|
-
```
|
|
368
|
+
## Key Features at a Glance
|
|
443
369
|
|
|
444
|
-
|
|
370
|
+
### 75+ Available Fields
|
|
445
371
|
|
|
446
|
-
|
|
372
|
+
The server provides comprehensive coverage across categories:
|
|
447
373
|
|
|
448
|
-
|
|
374
|
+
- **Fundamental** - Core metrics (ROE, P/E, P/B), valuation (EV, EV/EBIT, PEG), margins (gross, operating, pre-tax), returns (ROA, ROIC), balance sheet (debt, assets, current ratio)
|
|
375
|
+
- **Technical** - RSI, moving averages (SMA50, SMA200), volatility, beta
|
|
376
|
+
- **Performance** - Price, volume, growth metrics, sector/industry
|
|
449
377
|
|
|
450
|
-
**
|
|
451
|
-
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
452
|
-
**Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
378
|
+
See **[Complete Field Reference](docs/fields.md)** for all 75+ fields with descriptions and examples.
|
|
453
379
|
|
|
454
|
-
|
|
455
|
-
{
|
|
456
|
-
"mcpServers": {
|
|
457
|
-
"tradingview-local": {
|
|
458
|
-
"command": "node",
|
|
459
|
-
"args": ["/absolute/path/to/tradingview-mcp-server/dist/index.js"]
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
```
|
|
380
|
+
### 7 Preset Strategies
|
|
464
381
|
|
|
465
|
-
|
|
382
|
+
Pre-configured screens for common investment strategies:
|
|
466
383
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
384
|
+
| Preset | Style | Key Criteria | Columns |
|
|
385
|
+
|--------|-------|--------------|---------|
|
|
386
|
+
| `quality_stocks` | Conservative | ROE >12%, low debt, low volatility | 7 default |
|
|
387
|
+
| `value_stocks` | Value | P/E <15, P/B <1.5 | 7 default |
|
|
388
|
+
| `dividend_stocks` | Income | Yield >3%, low debt | 7 default |
|
|
389
|
+
| `momentum_stocks` | Momentum | RSI 50-70, golden cross | 7 default |
|
|
390
|
+
| `growth_stocks` | Growth | ROE >20%, margins >15% | 7 default |
|
|
391
|
+
| `quality_growth_screener` | Comprehensive | 16 filters, deep analysis | 35 extended |
|
|
392
|
+
| `market_indexes` | Market Regime | 13 global indexes (US, EU, Asia) | 16 extended |
|
|
471
393
|
|
|
472
|
-
**
|
|
394
|
+
See **[Preset Strategies Guide](docs/presets.md)** for detailed criteria, use cases, and examples.
|
|
473
395
|
|
|
474
396
|
## Important Notes
|
|
475
397
|
|
|
@@ -480,24 +402,51 @@ Add to your Claude Desktop config file:
|
|
|
480
402
|
- No official documentation or support from TradingView
|
|
481
403
|
- Use responsibly with rate limiting
|
|
482
404
|
|
|
483
|
-
## Limitations
|
|
405
|
+
## Investment Focus & Limitations
|
|
406
|
+
|
|
407
|
+
This tool is designed for **research and position selection**, not intraday trading:
|
|
484
408
|
|
|
485
|
-
- **Current snapshot
|
|
486
|
-
- **
|
|
487
|
-
- **
|
|
488
|
-
- **
|
|
409
|
+
- **Current fundamentals snapshot** - Latest quarterly/annual data for investment decisions (no tick-by-tick historical data needed)
|
|
410
|
+
- **Research-paced rate limits** - Conservative default (10 req/min) supports thorough analysis, not high-frequency trading
|
|
411
|
+
- **Strategic timeframes** - Daily/weekly data updates align with multi-month investment horizons
|
|
412
|
+
- **Fundamental-first approach** - Emphasizes financial metrics over intraday price action
|
|
413
|
+
|
|
414
|
+
**By design**, this tool doesn't support:
|
|
415
|
+
- Real-time tick data or intraday charts (not needed for position investing)
|
|
416
|
+
- High-frequency screening (research takes time and thought)
|
|
417
|
+
- Options chains or derivatives (focused on equity fundamentals)
|
|
418
|
+
- News feeds or sentiment analysis (focus on numbers and metrics)
|
|
489
419
|
|
|
490
420
|
## Contributing
|
|
491
421
|
|
|
492
422
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
493
423
|
|
|
424
|
+
For development setup and guidelines, see the **[Development Guide](docs/development.md)**.
|
|
425
|
+
|
|
494
426
|
## License
|
|
495
427
|
|
|
496
428
|
MIT License - see [LICENSE](LICENSE) file for details.
|
|
497
429
|
|
|
498
430
|
## Disclaimer
|
|
499
431
|
|
|
500
|
-
|
|
432
|
+
**Not Investment Advice**
|
|
433
|
+
|
|
434
|
+
This tool provides stock screening capabilities for informational and educational purposes only. It is **not investment advice, financial advice, or a recommendation** to buy or sell any security.
|
|
435
|
+
|
|
436
|
+
- All investment decisions are your sole responsibility
|
|
437
|
+
- Past performance does not indicate future results
|
|
438
|
+
- Screening results do not constitute investment recommendations
|
|
439
|
+
- Always conduct your own research and due diligence
|
|
440
|
+
- Consult qualified financial advisors before making investment decisions
|
|
441
|
+
- You may lose money investing in securities
|
|
442
|
+
|
|
443
|
+
**Software License**
|
|
444
|
+
|
|
445
|
+
This software is provided "AS IS" under the [MIT License](LICENSE), without warranty of any kind, express or implied. The authors and contributors are not liable for any damages or losses arising from use of this software.
|
|
446
|
+
|
|
447
|
+
**Third-Party Services**
|
|
448
|
+
|
|
449
|
+
This is an unofficial tool and is not affiliated with, endorsed by, or connected to TradingView. Use at your own risk. TradingView's unofficial API may change without notice.
|
|
501
450
|
|
|
502
451
|
## Links
|
|
503
452
|
|
|
@@ -508,4 +457,6 @@ This is an unofficial tool and is not affiliated with, endorsed by, or connected
|
|
|
508
457
|
|
|
509
458
|
---
|
|
510
459
|
|
|
460
|
+
**Smarter screens, not faster trades.**
|
|
461
|
+
|
|
511
462
|
Built with ❤️ using the [Model Context Protocol](https://modelcontextprotocol.io)
|