Skip to main content
Glama

start_walkforward

Run a walk-forward optimization of an indicator rule.

    No setting has to be settled before it runs: what the request leaves open (the stock or fund, the
    rule, the two settings to search and their ranges, the window lengths) runs with sensible defaults, which
    the result names in one short line; a change is a new run. `question` titles its report. The call waits
    for the run while it is likely to finish inside it, then answers with the result; the run's card in the
    chat shows the result or, for a longer run, how far it is, and fills in by itself, with the next steps as
    choices. A run started here needs no `show_report_card`.

    Walk-forward validates that a backtest's edge is not curve-fit by
    sliding a rolling window: re-fits parameters on `opt_bars` then
    applies them out-of-sample on the next `test_bars` and steps forward.

    Every account runs it within a daily allowance; a refused call does not count, and get_started and
    every run's answer give today's count.

    A run takes about 1 to 5 minutes. The call returns `{task_id, status,
    kind, dashboard_url}`; `get_walkforward_progress(task_id)` reports
    progress and, when the run has finished, carries `result`: the
    verdict on the windows the settings never saw, and for a run of a
    year or longer a few rounded figures (their return and Sharpe next
    to the tuned Sharpe, how many windows made money or never traded,
    and simply holding the stock over the same stretch).

    Args:
        ticker: Stock or ETF symbol (uppercase).
        base_config: The strategy, in the same shape as `start_backtest`'s
            arguments (entry_indicator, entry_conditions, exit_indicator,
            exit_conditions, ...), with conditions written
            `{"column": "MACDh_12_26_9", "operator": ">", "value": 0}`.
            The optimizer substitutes `param_x` and `param_y` into it
            across the grid.
        param_x / param_y: The two settings to grid over, each
            `{"name": ..., "min": ..., "max": ...}` with an optional
            "steps" (2-30; default `grid_steps`). "name" is one of:
              "entry.length"         a setting of the entry, exit or
                                     confirmation indicator ("exit.fast")
              "rsi.length"           the same, found by the indicator's id
                                     when exactly one lane uses it
              "entry.conditions[0]"  the number an entry, exit or
                                     confirmation condition compares against
            Indicator settings move in whole numbers: a decimal setting
            (Bollinger's std) runs at each whole number inside its range
            (a range holding fewer than two answers with QuanterLab's note
            and the nearest version, one tap), and a rule of the same lane
            written against the swept indicator's column (close above
            EMA_20) runs written the other way round, the same rule; the
            answer's `changed` says so in one line. A rule of another lane that reads the swept column is
            refused with what to change.
        opt_bars: In-sample window per fold (default 252 bars ≈ 1y daily),
            at least 30.
        test_bars: Out-of-sample window per fold (default 63 ≈ 3 months),
            at least 30.
        step_bars: Stride between folds. Defaults to `test_bars`.
        objective: Per-fold metric the grid is tuned on:
            'total_return_pct' (default) | 'sharpe' | 'profit_factor' |
            'win_rate'.
        grid_steps: Values per setting (default 3). The engine runs at
            most 250 backtests (every grid point in every window, plus
            a test run per window): five years of daily bars fit a
            3x3 grid, ten years a 2x2 grid or a longer step_bars. A
            larger request runs nothing and answers with QuanterLab's note
            and the nearest walk-forwards that fit (`offers`, each with its
            exact call).
        duration: Total history to walk through (default '5y').
        timeframe: '1d' (daily bars, the only timeframe this connector runs).
        question: Optional. One sentence restating what the run should answer, not the person's
            message: the title of the report the finished run becomes, and kept only as that.

    When the run has finished, its progress answer also carries
    `report_url`: the walk-forward written up as a QuanterLab report (the
    unseen months against holding the stock, window by window, the
    settings each window picked), which opens without a login.
    

Input Schema

NameRequiredDescriptionDefault
tickerYes
param_xYes
param_yYes
durationNo5y
opt_barsNo
questionNo
objectiveNototal_return_pct
step_barsNo
test_barsNo
timeframeNo1d
grid_stepsNo
base_configYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description discloses the 1–5 minute runtime, daily allowance behavior, refusal semantics, returned fields, progress behavior, report URL, grid-size limits, and fallback `offers` for oversized requests. These are meaningful operational traits not covered by the readOnly/openWorld/idempotent/destructive hints.

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 description is long but front-loads the core purpose, default behavior, and result flow before moving into the detailed Args section. It is necessarily detailed for a 12-parameter tool, though some phrasing and repeated caveats could be trimmed.

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 complexity, nested objects, no output schema, and limited annotations, the description is complete enough for an agent to call the tool correctly. It covers inputs, defaults, limits, async progress behavior, returned fields, and report generation.

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 across 12 parameters, the description fully compensates by documenting every argument, including defaults, minimums, enum values, nested `base_config` shape, `param_x`/`param_y` naming rules, and `grid_steps` limits. This adds substantial meaning beyond the bare 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 opens with a specific verb and resource: 'Run a walk-forward optimization of an indicator rule.' It also explains the walk-forward mechanic and distinguishes the tool from siblings by naming `get_walkforward_progress` and `show_report_card`.

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 makes the default-driven usage clear: settings left open run with sensible defaults, and 'a change is a new run.' It names the progress tool and says no `show_report_card` is needed, but it does not explicitly state when to choose this over a plain `start_backtest`.

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.

Resources