Skip to main content
Glama

TradingView-only: strategy backtest

stock_backtest

Backtest a trading strategy on any ticker or coin using TradingView and Yahoo price history, then compare results metric by metric to show which data feed produced the numbers.

Instructions

Backtest a strategy on a symbol, using each provider's own history.

The history is fetched from TradingView's chart feed and from Yahoo's chart API independently, and the strategy is run on each. The two results are compared metric by metric, if the OHLCV bars differ materially, the backtest is only as trustworthy as the feed it came from, and the response says which one produced the numbers shown.

Args: symbol: Ticker or coin (any instrument either provider quotes). strategy: One of rsi, bollinger, macd, ema_cross, supertrend, donchian, rsi_pullback, keltner_breakout, triple_ema. period: 6mo, 1y, 2y, 5y, … initial_capital: Starting cash. interval: 1d or 1h. include_trade_log: Include the per-trade log. include_equity_curve: Include the equity curve.

Returns: Envelope whose data_provider is ALL when both feeds answered, TRADINGVIEW/YAHOO when only one did (single-source), or NONE. comparisons holds the metric-by-metric agreement.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "symbol": "<symbol>",
      "strategy": "<strategy>"
    },
    "name": "stock_backtest"
  }
}

Input Schema

NameRequiredDescriptionDefault
periodNo1y
symbolYes
intervalNo1d
strategyYes
initial_capitalNo
include_trade_logNo
include_equity_curveNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose meaningful behavior: independent fetches from two feeds, a metric-by-metric comparison, and degradation to single-source with the reason stated in the response. Against that, the 'TradingView-only' title conflicts with the dual-feed narrative, and cost/latency implications of two network fetches plus any auth requirements are unstated.

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 action, then structured Args/Returns blocks, which is the right shape for a seven-parameter tool. The aside about the backtest being 'only as trustworthy as the feed it came from' is editorial but short, and the Returns block partly restates the output schema.

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 multi-provider tool with no annotations and 0% schema description coverage, the description covers execution model, fallback states, parameters, and response envelope, which is nearly enough to call it correctly. The gaps are selection guidance versus the compare sibling and any note on failure or partial-failure error surface.

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 0%, so the Args block is doing real work: it enumerates the nine valid strategy values and the '1d'/'1h' interval choices, neither of which the schema encodes as enums. A few entries are thin ('initial_capital: Starting cash') and period is only given as examples, so it stops short of fully compensating for the 0% coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence gives a specific verb and resource ('Backtest a strategy on a symbol') and adds scope ('using each provider's own history'). However, it never distinguishes itself from the obvious sibling 'stock_backtest_compare', and the title prefix 'TradingView-only' sits awkwardly against a description that repeatedly describes a two-feed TradingView + Yahoo run.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use or when-not-to-use guidance and no named alternative despite a sibling ('stock_backtest_compare') that appears to overlap heavily. The description explains how the tool executes internally, but never tells an agent under what conditions it should prefer this tool over a plain single-source backtest.

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