Skip to main content
Glama
lightkeeper90

ultimate-tradingview-agent

walk_forward_backtest_strategy

Detect overfitting by backtesting strategies on unseen data using walk-forward folds. Get a robustness score and verdict to determine if the strategy is safe for live trading.

Instructions

Walk-forward backtest to detect overfitting — validates strategy on unseen data.

Splits historical data into n_splits folds. Each fold:

  • Train (70% by default): strategy runs in-sample

  • Test (30% by default): strategy runs on unseen forward data

Robustness score (out-of-sample / in-sample performance ratio):

= 0.8 → ROBUST — no overfitting, safe to consider for live trading = 0.5 → MODERATE — some degradation out-of-sample, use with caution = 0.2 → WEAK — significant degradation, likely curve-fitted < 0.2 → OVERFITTED — fails on unseen data, do not trade live

Args: symbol: Yahoo Finance symbol (AAPL, BTC-USD, SPY…) strategy: rsi | bollinger | macd | ema_cross | supertrend | donchian period: Historical data period: '1mo', '3mo', '6mo', '1y', '2y' (recommend '2y' for meaningful walk-forward splits) 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: Timeframe: '1d' (daily, default) or '1h' (hourly)

Returns: Per-fold train/test metrics, aggregate robustness score, verdict, and combined out-of-sample performance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNo2y
symbolYes
intervalNo1d
n_splitsNo
strategyYes
train_ratioNo
slippage_pctNo
commission_pctNo
initial_capitalNo
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly explains the fold splitting, train/test ratios, robustness score calculation, and the meaning of each score threshold (ROBUST, MODERATE, WEAK, OVERFITTED). It also describes the return value structure, giving the agent a clear mental model of the tool's operation.

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 clear summary, fold explanation, threshold list, and parameter breakdown. Despite its length, every section adds necessary information and the formatting (bullet points, bold thresholds) makes it easy to scan. No fluff or redundancy.

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 tool's complexity (9 params, no output schema, no annotations), the description is remarkably complete. It covers the algorithm, all parameter semantics, return values, and threshold interpretations. The agent has enough context to select and invoke the tool correctly without additional documentation.

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?

The schema description coverage is 0%, but the description's 'Args' section provides complete semantics for all 9 parameters, including allowed values for 'strategy' (e.g., 'rsi | bollinger | macd'), examples for 'symbol', defaults, and constraints (e.g., 'max: 10' for n_splits). This adds substantial meaning beyond the raw 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: 'Walk-forward backtest to detect overfitting — validates strategy on unseen data.' This clearly states what the tool does and distinguishes it from siblings like 'backtest_strategy' and 'compare_strategies' by emphasizing walk-forward methodology and overfitting detection.

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 clearly implies when to use this tool: to detect overfitting and validate on unseen data. It also provides concrete guidance, such as recommending '2y' period for meaningful splits. However, it does not explicitly list when not to use it or name alternative tools, so it falls short of the highest standard.

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/lightkeeper90/ultimate-tradingview-agent'

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