Skip to main content
Glama

Walk-Forward Backtest

walk_forward_backtest_strategy
Read-only

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

NameRequiredDescriptionDefault
periodNo2y
symbolYes
intervalNo1d
n_splitsNo
strategyYes
train_ratioNo
slippage_pctNo
commission_pctNo
initial_capitalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare the safe read-only, non-destructive profile, so the bar is lower. The description adds real behavioral context beyond that: the fold/train-test methodology implied by overfitting detection, the SMA200 warmup constraint that excludes rsi_pullback and triple_ema, and the n_splits max of 10. It does not describe runtime cost or the shape of results, but the added methodology is substantive.

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?

Front-loaded with the one-line purpose, then a clean Args block; no filler sentences. The block is long, but every line documents a parameter that the schema leaves completely undescribed, so the length is earned rather than padded.

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, no-annotation-detail tool the description covers invocation fully. The one gap is that with no output schema, it never says what a walk-forward run returns (per-fold metrics, summary), which an agent would want before calling. Otherwise 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?

Schema description coverage is 0%, so the description carries the full burden and does: it enumerates all nine parameters with semantics, accepted strategy/period/interval values, defaults, and units (USD, %, fraction). It goes further with actionable guidance such as the '2y' recommendation and the per-fold capital interpretation.

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 opening line states a specific verb and resource ('walk-forward backtest') and immediately names the distinguishing purpose: detecting overfitting by validating on unseen data. This separates it cleanly from plain backtest_strategy/run_backtest siblings without opening either schema.

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?

Gives concrete routing advice for unsupported strategies ('use run_backtest with period="2y"') and recommends period='2y'. It does not, however, state when an agent should prefer a walk-forward backtest over a simpler backtest_strategy or compare_strategies call, so the guidance is strong on exclusions but incomplete on positive selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.