---
title: "批量回测（多标的 × 多策略对比）"
method: GET
path: "/v1/backtest-batch"
tags: ["pro"]
---

# 批量回测（多标的 × 多策略对比）

`GET /v1/backtest-batch`

## Request

- Base URL: `https://api.ashareapi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.ashareapi.com/v1/backtest-batch`
- Auth: none declared

⭐ **批量回测**：一次跑**多只标的 × 多个策略**，返回对比矩阵（谁表现最好）。

**与 `/v1/backtest` 的关系**：单次模式跑「1 票 × 1 策略」；本端点跑「N 票 × M 策略」—— 适合**选策略 / 选票**的横向对比。

⚠️ **规模上限**（单次请求）：
- 标的 ≤ 20 只 · 策略 ≤ 10 条 · **组合总数 ≤ 60**
- **超限直接拒绝**（⛔ 不静默截断 —— 截断会让你以为全跑了）

⚠️ **单票失败不中断整批**（该组合记 `error`，其余照跑）。
⚠️ **成本与约束同 `/v1/backtest`**（佣金/印花税/过户费/滑点 · 涨跌停 · 停牌）。

⚠️ 属**付费层**（需 API Key）—— 门槛 **`pro`（¥99）及以上**。
⚠️ **日额度**：`pro` 20 次 / 日 · `unlimited` 100 次 / 日。

## Query parameters

- `codes` string, required: 逗号分隔的标的（≤20 只），如 sh600519,sz000001
- `strategies` string: 逗号分隔的策略名（≤10 条）
- `start` string: 起始日 YYYY-MM-DD
- `end` string: 结束日 YYYY-MM-DD（省略=最新）
- `initial_cash` number: 初始资金（每次回测）

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/ashareapi/apis/a-api.md) · [All operations](https://skmtc.dev/ashareapi/apis/a-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ashareapi/apis/a-api/revisions/fc57bdcb13d5?raw)
