Skip to main content
Glama
rkilchmn

tradingview-mcp-server

by rkilchmn

walk_forward_backtest_strategy

Read-only

Validate a strategy on unseen data to detect overfitting via walk-forward backtesting. Split historical data into folds, train on one segment and test on the next to confirm robust performance.

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, openWorldHint=true, destructiveHint=false, so the safety profile is clear. The description adds meaningful behavioral context by explaining why some strategies are unsupported ('SMA200 warmup exceeds typical fold size'), the fold-based evaluation approach from training to unseen test data, and the per-fold capital structure—useful context beyond the annotations.

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 opening sentence is a crisp thesis, and the Args block is well-organized for parsing. However, the Args section restates defaults already present in the schema (e.g., 0.05, 10000) and is fairly long. It's efficient enough to be skimmable but slightly redundant with schema values that the agent could fetch on its own.

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

Completeness4/5

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

For a 9-parameter tool, the description thoroughly covers what, why, and when, including a critical sibling alternative. The main gap is that it doesn't describe expected return values or output shape, and there's no output schema to fill the void. It also doesn't mention error cases, but for a backtest with no side effects, the provided context is nearly complete.

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?

With 0% schema description coverage, the description carries the full burden—and it delivers. Every parameter is documented with units, defaults, accepted values, and slot semantics (e.g., 'per fold', 'fraction of each fold used for training'). The description even clarifies constraints like n_splits max=10 that the schema leaves implicit. This is a model example of compensating for absent schema descriptions.

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 leads with a specific verb and resource combination—'Walk-forward backtest to detect overfitting'—and explains the mechanism ('validates strategy on unseen data'). It clearly differentiates this walk-forward variant from standard backtests by naming the core purpose and the range of strategies it supports.

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 explicitly routes unsupported strategies (rsi_pullback, triple_ema) to run_backtest with a specific period, giving the agent an unambiguous alternative. It also advises a preferred period ('recommend 2y') and constrains n_splits to a max of 10, providing decisions rather than just definitions.

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