Skip to main content
Glama
atilaahmettaner

tradingview-mcp

backtest_strategy

Backtest any trading strategy on historical data and obtain institutional-grade performance metrics.

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
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses parameter details including defaults and a specific constraint for certain strategies, but does not mention the return format, error behavior, or whether the operation is read-only. The phrase 'institutional-grade metrics' is vague and lacks specifics, reducing transparency.

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

Conciseness4/5

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

The description is well-structured with an Args section and bullet-like parameter list. It is concise but includes necessary details. Minor reduction for not being even more succinct, e.g., removing redundant 'Args:' header.

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?

Given 9 parameters and no output schema, the description covers all inputs adequately but fails to explain the output (return values, metrics). For a complex tool, this is a significant gap. The inclusion of parameter defaults and strategy-specific notes helps, but missing output details reduces completeness.

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?

The description adds substantial meaning beyond the input schema, which has 0% coverage. It provides example values for symbol (e.g., AAPL, BTC-USD), lists all strategy options with enum-like clarity, and explains defaults for numeric parameters. This fully compensates for the schema's lack of descriptions.

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

Purpose4/5

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

The description clearly states the tool's purpose: backtesting a trading strategy on historical data with institutional-grade metrics. It provides a verb (Backtest) and specific resource (trading strategy + historical data). While it distinguishes from sibling tools like compare_strategies by focusing on single strategy backtesting, it does not explicitly differentiate from walk_forward_backtest_strategy, leaving some ambiguity.

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

Usage Guidelines2/5

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

The description lacks explicit guidance on when to use this tool versus alternatives. It only provides a constraint note for rsi_pullback and triple_ema strategies needing period >= '1y'. No mention of when not to use it, prerequisites, or comparison with sibling tools like compare_strategies or walk_forward_backtest_strategy.

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/atilaahmettaner/tradingview-mcp'

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