Skip to main content
Glama

walk_forward_backtest

Validate a trading strategy out-of-sample and detect curve-fitting by testing on unseen data in multiple folds. Optimizes on past data, scores future folds, and compares results for a verdict.

Instructions

Validate a strategy out-of-sample and check whether it is curve-fitted.

Args: symbol: Ticker. strategy: Strategy name from list_strategies. market: "crypto", "stock" or "idx". interval: Candle size. bars: Candles to use. Needs roughly 40 x (folds + 1) minimum. folds: Number of out-of-sample test windows (2-10). objective: Metric the parameter search optimises for. fee_bps: Fee in basis points per position change. slippage_bps: Slippage in basis points per position change.

Optimises parameters on data up to each fold, then scores the fold that follows on bars the optimiser never saw. The verdict compares in- and out-of-sample results: this is the tool that catches a strategy that only looks good in hindsight.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
barsNo
foldsNo
marketNocrypto
symbolYes
fee_bpsNo
intervalNo1d
strategyYes
objectiveNosharpe
slippage_bpsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully explains the behavioral process: 'Optimises parameters on data up to each fold, then scores the fold that follows on bars the optimiser never saw' and describes the verdict comparison. This discloses the methodology and the tool's role in detecting overfitting, going well beyond a simple action statement.

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 well-structured with a front-loaded purpose, an organized Args list, and a concise process explanation. Every sentence adds value; no redundant or filler content is present.

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?

Despite having 9 parameters and an output schema, the description provides a complete picture: it explains the tool's purpose, the walk-forward mechanism, the meaning of each parameter, and how the verdict works. The presence of an output schema means return values need not be detailed, and the description fills all other context gaps.

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%, and the description fully compensates by explaining every parameter in the Args list. It adds meaningful constraints (e.g., 'bars: Needs roughly 40 x (folds + 1) minimum') and clarifies the source for strategy ('Strategy name from list_strategies'), which is not present in the schema.

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 specific purpose: 'Validate a strategy out-of-sample and check whether it is curve-fitted.' This is a specific verb+resource phrase that distinguishes it from regular backtesting (e.g., backtest_strategy) and other sibling tools.

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 implies when to use the tool by emphasizing out-of-sample validation and curve-fit detection ('this is the tool that catches a strategy that only looks good in hindsight'). However, it does not explicitly name alternative tools or state when not to use it, so it falls just short of full explicit 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/kumaraprayoga68-sketch/market-mcp'

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