Skip to main content
Glama

A股数据 API (A-Share Data API)

ashare_backtest_batch

批量回测:一次跑 多标的 × 多策略,返回对比矩阵(哪个组合最好一目了然)。用户问'这几只股票用不同策略分别跑一下/批量回测/策略对比'用这个。⚠️ 与 ashare_backtest 的区别:本工具一次给多标的×多策略的横向对比,ashare_backtest 只跑一个策略。⚠️ 上限:标的 ≤20 · 策略 ≤10 · 组合 ≤60(超限直接报错,不静默截断)。⚠️ 组合策略不能用于批量回测(批量只支持单标的择时策略)。⚠️ 参数可传列表(自动转逗号)。⚠️ 付费工具(需 Key):Pro(¥69)及以上,有独立日额度。

Input Schema

NameRequiredDescriptionDefault
endNo结束日期 YYYY-MM-DD
codesYes股票代码,多个用逗号分隔:sh600667,sz000001(≤20 只)
startNo起始日期 YYYY-MM-DD(默认 2019-01-01)2019-01-01
strategiesYes策略名,多个用逗号分隔:buy_hold,mom20(≤10 个)
initial_cashNo初始资金(默认 1000000 = 100 万)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses hard limits (≤20 codes, ≤10 strategies, ≤60 combos), that over-limit fails loudly rather than silently truncating, that combo strategies are unsupported, and that it is a paid tool requiring Pro (¥69) with its own daily quota. It stops short of describing auth mechanics or response shape, but the safety/constraint profile is well covered.

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?

The key point (batch multi-symbol × multi-strategy comparison) is front-loaded, followed by routing guidance and warnings. It is dense and emoji-heavy but nearly every clause earns its place; the formatting is slightly noisy but not padded.

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?

An output schema exists, so return values need not be explained, and the description still notes the comparison-matrix output. Combined with the limits, paid-tier requirement, and strategy-type restriction, an agent has everything needed to invoke this correctly versus its sibling.

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 coverage is 100%, so the baseline is 3, but the description adds value beyond the schema: parameters may be passed as lists and are auto-converted to comma-separated strings, and per-parameter count ceilings are restated. This exceeds what the schema alone conveys.

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 states a specific verb+resource (批量回测: 多标的 × 多策略, returns a comparison matrix) and explicitly contrasts itself with the sibling ashare_backtest (single strategy). An agent can distinguish this tool from ashare_backtest and ashare_strategies without opening any schema.

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?

It names the exact user phrasings that should trigger this tool ('这几只股票用不同策略分别跑一下/批量回测/策略对比') and gives the alternative plus the condition selecting it (ashare_backtest for a single strategy). When-to-use and when-to-use-the-other are both explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources