Skip to main content
Glama
btanaji

TradingView MCP

by btanaji

walk_forward_backtest_strategy

Read-only

Detect overfitting in trading strategies by validating on unseen data. Walk-forward backtesting reveals true strategy robustness across multiple folds.

Instructions

Walk-forward backtest to detect overfitting — validates strategy on unseen data.

Args: symbol: Yahoo Finance symbol (AAPL, BTC-USD, SPY…) strategy: rsi | bollinger | macd | ema_cross | supertrend | donchian | keltner_breakout (rsi_pullback and triple_ema not supported here — SMA200 warmup exceeds typical fold size; use run_backtest with period='2y') period: '1mo', '3mo', '6mo', '1y', '2y' (recommend '2y') initial_capital: Starting capital per fold in USD (default $10,000) commission_pct: Per-trade commission % (default 0.1%) slippage_pct: Per-trade slippage % (default 0.05%) n_splits: Number of walk-forward folds (default 3, max 10) train_ratio: Fraction of each fold used for training (default 0.7) interval: '1d' (daily) or '1h' (hourly)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNo2y
symbolYes
intervalNo1d
n_splitsNo
strategyYes
train_ratioNo
slippage_pctNo
commission_pctNo
initial_capitalNo
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds meaningful behavioral context beyond annotations, such as the unsupported strategies due to SMA200 warmup exceeding typical fold size, the n_splits max of 10, and the per-fold capital semantics. It does not contradict annotations.

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 front-loaded with a one-sentence purpose, followed by a tightly organized Args list. Every line provides operational value—no fluff or redundant information. It is appropriately sized for the parameter count.

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

Completeness5/5

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

Given the tool's complexity (9 parameters, no output schema), the description is complete: it covers purpose, usage constraints, alternative tools, and all parameter semantics. An agent can correctly select and invoke the tool based solely on this description.

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 input schema has 0% description coverage, but the description thoroughly documents all 9 parameters: symbol format, allowed strategy values, period options with a recommendation, defaults, and constraints. It adds meaning beyond bare names, including units, max values, and per-fold context.

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 states the tool's purpose: 'Walk-forward backtest to detect overfitting — validates strategy on unseen data.' This uses a specific verb and resource, and distinguishes it from sibling tools like backtest_strategy by emphasizing the walk-forward methodology and overfitting detection.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance, including which strategies are not supported (rsi_pullback, triple_ema) and directs users to an alternative: 'use run_backtest with period="2y"'. It also recommends '2y' for the period parameter, giving clear context for when to use this tool.

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

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