tradingview-mcp-server: Command for Claude Code

.claude/commands/portfolio-risk.md

portfolio-risk is a command for Claude Code from fiale-plus/tradingview-mcp-server. It costs 21 tokens per session (1,117 once invoked), scanned A, original, MIT.

A command for analysing risk in a stock portfolio, including how holdings are grouped by sector and how sensitive or volatile they are.

In plain words
What is it for?
Use it with two to twenty stock symbols to review prices, sectors, market value, beta, volatility, performance, debt, and dividend yield.
Why use it?
It helps reveal whether a portfolio is too concentrated or exposed to similar market movements.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is fiale-plus/tradingview-mcp-server's own configuration. It tells Claude Code how to work on tradingview-mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tradingview-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to fiale-plus/tradingview-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/fiale-plus/tradingview-mcp-server/main/.claude/commands/portfolio-risk.md
Clone the repo
git clone --depth 1 https://github.com/fiale-plus/tradingview-mcp-server

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for portfolio-risk

README.md
[![agentmods](https://agentmods.dev/badge/commands/fiale-plus/tradingview-mcp-server/portfolio-risk/github.svg)](https://agentmods.dev/commands/fiale-plus/tradingview-mcp-server/portfolio-risk)
Your own site
<a href="https://agentmods.dev/commands/fiale-plus/tradingview-mcp-server/portfolio-risk"><img src="https://agentmods.dev/badge/commands/fiale-plus/tradingview-mcp-server/portfolio-risk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for portfolio-risk

Your own site · 80×15
<a href="https://agentmods.dev/commands/fiale-plus/tradingview-mcp-server/portfolio-risk"><img src="https://agentmods.dev/badge/commands/fiale-plus/tradingview-mcp-server/portfolio-risk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,117 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.01117
Opus 5 $0.00010 $0.00558
Sonnet 5 $0.00004 $0.00223
Haiku 4.5 $0.00002 $0.00112

Measured 9d ago against content hash be13865d5749, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

portfolio-risk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/portfolio-risk.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Portfolio Risk Analysis

Analyze concentration risk, market sensitivity, and volatility profile for a portfolio of stocks.

Steps:

  1. Parse holdings from $ARGUMENTS

    • Accept comma-separated or space-separated symbols: AAPL, MSFT, GOOGL, JPM, XOM
    • Accept 2 to 20 symbols
    • If no exchange prefix is provided, try NASDAQ: then NYSE:
    • If fewer than 2 symbols are provided, prompt the user for at least 2
  2. Fetch data using mcp__tradingview__lookup_symbols

    • symbols: [all normalized symbols]
    • columns:
      • name, close, market_cap_basic, sector, industry
      • beta_1_year, ATR, Volatility.M
      • Perf.Y, Perf.YTD
      • debt_to_equity, dividends_yield_current
  3. Portfolio Overview Table Display all holdings with key metrics:

    | Symbol  | Name                 | Price    | Mkt Cap | Sector               | Beta | Div Yield% | 1Y%   |
    |---------|----------------------|----------|---------|----------------------|------|------------|-------|
    | AAPL    | Apple Inc            | $185.92  | 2.87T   | Technology           | 1.24 | 0.55%      | +24.2 |
    | MSFT    | Microsoft Corp       | $415.30  | 3.08T   | Technology           | 0.90 | 0.73%      | +31.5 |
    
    • Truncate names to 20 characters
    • Format market caps with B/T suffix
  4. Concentration Analysis

    Sector Breakdown:

    • Count holdings per sector
    • Calculate % of portfolio by count (treat equal-weight if no position sizes given)
    • Display as a table:
      | Sector         | Holdings | % of Portfolio | Risk Flag |
      |----------------|----------|----------------|-----------|
      | Technology     | 3        | 60%            | ⚠️ HIGH   |
      | Financials     | 1        | 20%            | OK        |
      | Energy         | 1        | 20%            | OK        |
      
    • Flag any sector with >40% of holdings as "⚠️ HIGH concentration risk"
    • Flag any sector with >60% as "❌ CRITICAL concentration risk"

    Industry Breakdown:

    • List any industry where 2+ holdings overlap
    • Warn: "X holdings in [Industry] — high correlation risk"

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 99 lines · 21 tokens per session scan A be13865d5749

Subscribe to this mod's changes

portfolio-risk is a command published in the GitHub repository fiale-plus/tradingview-mcp-server (50 stars, last pushed 18d ago), licensed MIT. It adds 21 tokens to every session and 1,117 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.