Skip to main content
Glama
GlynnCarson

tradingview-mcp

by GlynnCarson

walk_forward_backtest_strategy

Read-only

Walk-forward validate trading strategies on out-of-sample data folds to detect overfitting and improve robustness.

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 indicate readOnlyHint=true and non-destructive. The description adds valuable context: the walk-forward nature validates on unseen data, and some strategies fail due to SMA warmup exceeding typical fold size. However, it does not disclose potential output format or error handling details beyond parameter constraints.

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?

Extremely concise and structured: one-line purpose, then formatted Args block. Every sentence adds value without redundancy or fluff. Perfect front-loading of the core function.

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?

The description covers purpose, parameters, and usage guidelines thoroughly. However, though there is no output schema, the description does not mention return values or what the agent can expect from the response. A brief note on output would make it fully complete for a tool of this complexity.

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 fully compensates. It provides detailed args: lists supported strategies, gives examples for symbol, recommends period, explains defaults for capital, commission, slippage, n_splits, train_ratio, and interval. This goes far beyond the schema's minimal property titles.

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 does a 'Walk-forward backtest to detect overfitting — validates strategy on unseen data.' This specific verb+resource combination distinguishes it from siblings like 'backtest_strategy' and 'bracket_backtest' that lack the walk-forward overfitting detection aspect.

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?

Explicitly states when to use this tool vs alternatives: notes that 'rsi_pullback and triple_ema not supported here' and recommends 'use run_backtest with period='2y'' for those strategies. Also recommends '2y' period for best results.

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/GlynnCarson/tradingview-mcp'

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