Skip to main content
Glama
atilaahmettaner

tradingview-mcp

walk_forward_backtest_strategy

Detect strategy overfitting by walk-forward backtesting on historical data, training on one period and validating on unseen data.

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

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

No annotations are provided, so the description must fully disclose behavior. It explains the walk-forward validation concept and parameters, but does not mention whether the tool modifies any data, has state, or what the output format is. The agent knows it's a computation but lacks details on side effects or return structure.

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 concise and well-structured: a one-sentence summary followed by a clear bulleted list of arguments. Every sentence serves a purpose, and there is no superfluous text. The format aids quick scanning by an AI agent.

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 the tool's complexity (9 parameters, no annotations, no output schema), the description covers inputs well but omits any description of the output. An agent selecting this tool needs to know what it returns (e.g., metrics, fold results) to decide if it suits the task. This gap 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 provides thorough explanations for all 9 parameters, including allowed values (e.g., strategy enum, period formats), defaults, and recommendations. Since the input schema has 0% description coverage, the description fully compensates by adding essential meaning beyond property titles.

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 core function: 'Walk-forward backtest to detect overfitting — validates strategy on unseen data.' This is a specific verb-resource pair. However, it does not explicitly differentiate from sibling backtest tools like backtest_strategy, leaving the agent to infer when to choose this over alternatives.

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

Usage Guidelines4/5

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

The description explicitly lists two strategies (rsi_pullback, triple_ema) that are NOT supported in this tool and directs users to 'use run_backtest with period='2y'' instead. This provides clear when-not-to-use guidance. However, it lacks a general statement about when to prefer walk-forward over a standard backtest.

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