Skip to main content
Glama
rkilchmn

tradingview-mcp-server

by rkilchmn

backtest_strategy

Read-only

Backtest trading strategies (RSI, MACD, EMA cross, etc.) on historical market data to evaluate performance with metrics like returns, drawdown, and trade logs.

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?

Annotations already declare readOnlyHint=true and destructiveHint=false, so the description does not need to cover safety. It adds useful behavioral context through constraints like the SMA200 warmup requirement and the optional include_trade_log/include_equity_curve flags. However, it does not disclose output format, failure modes, data range limitations, or performance characteristics beyond what the parameter list implies.

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 opens with a clear one-sentence purpose, then uses a structured Args block that is efficient for nine parameters. It is appropriately sized and front-loaded. Minor vagueness like 'institutional-grade metrics' is the only non-essential element, preventing a perfect score.

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?

The description thoroughly covers all input parameters and usage constraints, which is essential given 9 parameters and no output schema. However, since there is no output schema, the description should also explain what the backtest returns, such as the performance metrics included in the report, but it only vaguely references 'institutional-grade metrics' and optional trade log/equity curve flags.

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 carries the full burden for parameter meaning. It does this well: it gives valid examples for symbol, enumerates strategy names, defines period options, states defaults, explains commission/slippage as per-trade percentages, and specifies interval choices. It also adds the critical warmup-period constraint for two strategies. This fully compensates for the missing schema 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 uses a specific verb and resource: 'Backtest a trading strategy on historical data' with 'institutional-grade metrics.' It clearly identifies what the tool does, but it does not distinguish itself from sibling tools like compare_strategies or walk_forward_backtest_strategy, so it falls short of a 5.

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 implied usage guidance by listing allowed strategies, periods, intervals, and constraints such as 'rsi_pullback and triple_ema need period >= 1y for SMA200 warmup.' However, it does not explicitly state when to use this tool versus alternatives like compare_strategies or walk_forward_backtest_strategy, and gives no explicit when-not-to-use guidance.

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

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