Skip to main content
Glama
tedorigawa001

TradingView-MCP

run_strategy_walk_forward

Run a bounded walk-forward evaluation of Pine strategies from immutable ledgers. Splits trades into train/test windows, selects candidates on train metrics only, and exposes only selected test results.

Instructions

Run a bounded Pine Strategy walk-forward evaluation from full, immutable trade ledgers. Two to eight exact saved strategy/input candidates are collected serially on the bound chart, then partitioned into two to twelve explicit train, embargo, and test windows by closed-trade entry/exit time. Selection uses train metrics only; only the selected candidate's test metrics are exposed. Candidate failure, ledger quality issues, cost-condition differences, ties, and insufficient samples are not silently ignored. Without confirm=true this only previews the plan. Never places orders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes
foldsYes
confirmNo
candidatesYes
embargo_barsNoClosed bars between train and test. Default: 1
expected_symbolYes
selection_metricNoTrain-only metric to maximize. Default: expectancy
expected_timeframeYes
falsification_auditNoOptional #45 ledger-level falsification audit. It replays the same candidate selection and OOS rule over centered, shared-calendar-block sign-flipped trade profits after full ledgers are collected. Candidate status requires a one-sided empirical post-selection OOS net-profit p-value at nominal alpha.
max_runtime_secondsNoDo not start another candidate after this soft deadline. Default: 600
minimum_test_tradesNoTrades required for each selected OOS fold. Default: 10
minimum_train_tradesNoTrades required to select a candidate in each train fold. Default: 30

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.10

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and succeeds: 'Never places orders,' 'Without confirm=true this only previews the plan,' 'Selection uses train metrics only; only the selected candidate's test metrics are exposed,' and the explicit list of failure conditions that are 'not silently ignored' are all material disclosures beyond the schema.

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?

Six short sentences, each adding unique information. The main purpose is front-loaded, and there is no filler or tautology; even the list of failure conditions is compressed into one clause.

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 complex 12-parameter tool with no output schema and no annotations, the description covers the execution model, preview behavior, data source, and safety profile. Remaining gaps are minor: no explicit guidance on mode, expected symbol/timeframe, or alternative tool routing, though the schema partially fills those gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 50%, and the description adds meaning to core required parameters: candidates are 'exact saved strategy/input candidates collected serially,' folds are explicit partitions with train/embargo/test windows, and confirm controls preview versus execution. It does not explain anchored vs rolling mode or expected_symbol/timeframe, so it is not a 5.

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 bounded Pine Strategy walk-forward evaluation from full, immutable trade ledgers.' It further differentiates the tool by describing candidate collection, train/embargo/test partitioning, and selection semantics, making it clearly distinct from the many backtest and experiment siblings.

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?

It provides clear context for when to use this tool: bounded walk-forward evaluation using exact saved candidates and explicit train/embargo/test folds. It does not explicitly name alternatives or state 'use run_backtest instead,' so it stops short of a 5.

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