Skip to main content
Glama

TradingView-only: strategy backtest

stock_backtest

Backtest trading strategies like RSI, MACD, or EMA cross on stocks and coins using TradingView data, returning performance metrics and optional trade logs or equity curves.

Instructions

Backtest a strategy on a symbol (TradingView-only, single-source).

Finviz has no OHLCV history endpoint, so this cannot be cross-verified. The response is labelled TRADINGVIEW and the notice says so.

Args: symbol: Ticker or coin. 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 labelled TRADINGVIEW with performance metrics.

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

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does disclose a genuinely important behavioral trait: the output is single-source and labelled TRADINGVIEW because it cannot be cross-verified. That pre-empts over-trust in results. It still omits compute cost, latency, and whether the backtest is deterministic or subject to lookahead/parameter-fitting caveats.

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-loads the one-line purpose before the caveat, then uses compact Args/Returns sections that are easy to scan. The structure is efficient; the only redundancy is restating the TRADINGVIEW label twice (in the caveat and in Returns).

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?

An output schema exists, so the brief Returns note is sufficient and the description rightly spends its budget on parameters and the single-source caveat. What is missing relative to a 7-parameter analytics tool is routing guidance to stock_backtest_compare and any hint about runtime cost when equity curve and trade log are enabled.

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%, yet the description documents all seven parameters, including the nine valid strategy values, period formats like 6mo/1y/2y/5y, and interval options 1d/1h -- meaning the schema alone would not. The remaining weakness is thin treatment of initial_capital (no currency or unit) and the two include_* flags, whose output-cost implications are unstated.

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?

States a specific verb and resource: 'Backtest a strategy on a symbol', plus a clear scoping qualifier (TradingView-only, single-source). It does not name the obvious sibling stock_backtest_compare, so the agent must infer which backtest tool to pick, but the purpose itself is unambiguous.

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

Usage Guidelines3/5

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

It gives a useful constraint -- Finviz has no OHLCV history, so results cannot be cross-verified -- which tells the agent why this tool is the only option for backtesting. However, it never says when to use this versus stock_backtest_compare or technical_analysis, and offers no prerequisites or exclusions for strategy selection.

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