Skip to main content
Glama
GlynnCarson

tradingview-mcp

by GlynnCarson

backtest_strategy

Read-only

Backtest trading strategies on historical data using indicators like RSI, MACD, and Bollinger Bands. Get institutional-grade metrics including equity curve and trade log.

Instructions

Backtest a trading strategy on historical data with institutional-grade metrics.

Args: symbol: Yahoo Finance symbol (AAPL, BTC-USD, THYAO.IS, ^GSPC) strategy: rsi | bollinger | macd | ema_cross | supertrend | donchian | rsi_pullback | keltner_breakout | triple_ema (rsi_pullback and triple_ema need period >= '1y' for SMA200 warmup) period: '1mo', '3mo', '6mo', '1y', '2y' initial_capital: Starting capital in USD (default $10,000) commission_pct: Per-trade commission % (default 0.1%) slippage_pct: Per-trade slippage % (default 0.05%) interval: '1d' (daily) or '1h' (hourly) include_trade_log: Include full per-trade log (default False) include_equity_curve: Include equity curve data points (default False)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNo1y
symbolYes
intervalNo1d
strategyYes
slippage_pctNo
commission_pctNo
initial_capitalNo
include_trade_logNo
include_equity_curveNo
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint=true and destructiveHint=false. The description adds value by explaining strategy-specific prerequisites (e.g., warmup period for rsi_pullback and triple_ema), but does not discuss rate limits, failure modes, or data frequency constraints. The added context is sufficient for a read-only tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with an 'Args' section, front-loads the purpose, and each sentence is informative. No unnecessary words; coverage is comprehensive in a compact format.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description does not specify the return format (e.g., metrics dictionary, data types). While it mentions 'institutional-grade metrics', it fails to describe what the tool actually returns, which is needed for agent invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description fully compensates. It explains all 9 parameters with examples (symbol), lists valid strategies and periods, states defaults for initial_capital, commission_pct, slippage_pct, interval, include_trade_log, and include_equity_curve. It adds meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly uses the verb 'Backtest' and specifies the resource as 'a trading strategy on historical data with institutional-grade metrics'. It distinguishes this tool from siblings like 'compare_strategies' and 'walk_forward_backtest_strategy' by its focus on single-strategy backtesting.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context, such as the warmup requirement for certain strategies, but does not explicitly state when to use this tool versus alternatives or when not to use it. It lacks direct exclusions or guidance on tool selection among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GlynnCarson/tradingview-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server