---
title: china-a-share-l2-level2-limit-order-book-tick-data
canonical_url: "https://www.modelscope.cn/datasets/venvoo/china-a-share-l2-level2-limit-order-book-tick-data"
md_url: "https://www.modelscope.cn/datasets/venvoo/china-a-share-l2-level2-limit-order-book-tick-data.md"
repository: venvoo/china-a-share-l2-level2-limit-order-book-tick-data
last_updated: 2026-11-22
license: other
storage_size: "5.9 TB"
downloads: 3863652
stars: 15
---

# china-a-share-l2-level2-limit-order-book-tick-data

> china-a-share-l2-level2-limit-order-book-tick-data - venvoo 在 ModelScope 开源的数据集。China A-Share Level-2 Archive

venvoo/china-a-share-l2-level2-limit-order-book-tick-data 是 ModelScope 魔搭社区上的数据集，存储大小 5.9 TB，采用 other 许可。

- **Repository**: venvoo/china-a-share-l2-level2-limit-order-book-tick-data
- **License**: other
- **Storage size**: 5.9 TB
- **Downloads**: 3863652
- **Stars**: 15
- **Last updated**: 2026-11-22

Source: https://www.modelscope.cn/datasets/venvoo/china-a-share-l2-level2-limit-order-book-tick-data

---

# China A-Share Level-2 Archive

**2017–2026 · Quotes, orders and trades · Parquet**

A historical archive of Chinese exchange Level-2 data, supplied through a vendor export.
It includes ten-level quote snapshots, individual order messages and trade-stream records.
The files cover A-share stocks **and non-stock instruments** such as ETFs and bonds.
“Full-market” describes the export's scope, not a guarantee that every instrument or message is present.

中国证券市场 Level-2 历史数据归档，包含**十档行情、逐笔委托、逐笔成交**，按交易日保存为 Parquet。
数据来自供应商历史导出，范围含 A 股、ETF、债券等品种。
**“全市场”指收录范围，不表示每个品种、每条消息都完整。**

[English](#english) · [中文完整版](#中文说明) · [Quickstart / 下载示例](#quickstart) · [Files / 文件目录](/datasets/venvoo/china-a-share-l2-level2-limit-order-book-tick-data/tree/main)

## Archive at a glance / 归档概览

<!-- AUTO:glance -->
| On the Hub / 线上 | |
|---|---|
| **2,399 trading days / 交易日** | 2017-01-03 to 2026-11-20 |
| **584.92 billion rows / 5,849.24 亿行** | All three streams / 三类消息合计 |
| **6.48 TB** | 7,197 compressed Parquet files / 压缩文件 |

Every trading day in the repository carries all three streams, and `manifests.parquet` indexes every one of them.
仓库内每个交易日都含三条流，`manifests.parquet` 逐日索引全部。
<!-- /AUTO:glance -->

## English

### What you can download

<!-- AUTO:coverage-en -->
Everything. All **2,399** trading days from 2017-01-03 to 2026-11-20 are on the Hub with all three files present: **7,197** Parquet files, **6.48 TB** compressed. No date is partial.

Here, **complete means three files exist**. It does not certify a complete trading session.

| Year | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026¹ |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| Trading days | 244 | 243 | 244 | 243 | 243 | 242 | 242 | 242 | 243 | 213 |

¹ 2026 runs through November 20.
<!-- /AUTO:coverage-en -->

### Quickstart

Start with the small quality-control ledger and a repository listing. Download market files only after checking dates.

```bash
pip install -U huggingface_hub pyarrow duckdb
hf auth login   # gated repository: any read token works once your access request is approved
```

**Access is gated.** Two steps, then **Request access**: click ♥ Like at the top of this page, and follow
[@venvoo](https://huggingface.co/venvoo). Both are checked continuously and approved within seconds; a request
missing either one stays pending with no notification. Downloads need a logged-in token.

**Check file availability at one fixed revision.** This downloads only `manifests.parquet`, about 900 KB.
It separates dates inside the ledger from the newer dates the ledger does not yet cover.

```python
from collections import defaultdict
from huggingface_hub import HfApi, hf_hub_download
import pyarrow.parquet as pq

REPO = "venvoo/china-a-share-l2-level2-limit-order-book-tick-data"
api = HfApi()
REV = api.dataset_info(REPO).sha  # Freeze one revision for this run.
NEEDED = {"行情.parquet", "逐笔委托.parquet", "逐笔成交.parquet"}

files_by_day = defaultdict(set)
for path in api.list_repo_files(REPO, repo_type="dataset", revision=REV):
    parts = path.split("/")
    if (len(parts) == 2 and len(parts[0]) == 8
            and parts[0].isdigit() and parts[1] in NEEDED):
        files_by_day[parts[0]].add(parts[1])

complete = {d for d, files in files_by_day.items() if files == NEEDED}
partial = {d: sorted(NEEDED - files) for d, files in files_by_day.items()
           if files != NEEDED}
manifest_file = hf_hub_download(
    REPO, "manifests.parquet", repo_type="dataset", revision=REV
)
ledger = pq.read_table(manifest_file)
indexed = set(ledger["date"].to_pylist())

print("Revision:", REV)
print("Complete within manifest:", len(complete & indexed), "/", len(indexed))
print("Partial directories:", partial)
print("Manifest dates not complete:", len(indexed - complete))
print("Complete dates newer than/outside manifest:", sorted(complete - indexed))
```

**Download one file and select one symbol.** This example downloads the whole orders file,
about **2.43 GB**, then prunes row groups locally. It does not download only the matching rows.
Run it after the availability check above, keeping the same `REV`.

```python
DAY = "20260828"
if DAY not in complete:
    raise RuntimeError(f"{DAY} is not complete at revision {REV}")

orders_file = hf_hub_download(
    REPO, f"{DAY}/逐笔委托.parquet", repo_type="dataset", revision=REV
)
orders = pq.read_table(
    orders_file,
    columns=["wind_code", "time", "order_type", "order_code", "price", "volume"],
    filters=[("wind_code", "=", "600519.SH")],
)
print(orders.num_rows)
```

For a small remote query, DuckDB supports `hf://` paths through `httpfs`:

```sql
INSTALL httpfs;
LOAD httpfs;
SELECT time, price / 10000.0 AS price_cny,
       bid_px1 / 10000.0 AS best_bid_cny,
       ask_px1 / 10000.0 AS best_ask_cny
FROM 'hf://datasets/venvoo/china-a-share-l2-level2-limit-order-book-tick-data@8b76b0669a8a3d24161fb698db0338810f9f768b/20260828/行情.parquet'
WHERE wind_code = '600519.SH'
ORDER BY time;
```

Remote queries can skip row groups but still incur HTTP requests and transfer costs.
Use local files for repeated scans. Pin and cite the repository commit for reproducible work.

### Three streams, three schemas

| File | Contents | Columns |
|---|---|---:|
| **行情.parquet** | Ten-level quote snapshots, roughly every 3 seconds per symbol | **66** |
| **逐笔委托.parquet** | Individual order messages; cancellation encoding depends on venue | **10** |
| **逐笔成交.parquet** | Executions and, for Shenzhen, cancellation records | **12** |

<img src="assets/v3_streams_en_light.svg" alt="Historical archive row shares: orders 51.8%, trades 40.5%, quotes 7.7%." width="624" class="chart chart-light dark:hidden" />
<img src="assets/v3_streams_en_dark.svg" alt="Historical archive row shares: orders 51.8%, trades 40.5%, quotes 7.7%." width="624" class="chart chart-dark hidden dark:block" />

Trade-stream rows include Shenzhen cancellations, not only executions.

<details>
<summary><strong>Exact message counts</strong></summary>

| Stream | Rows | Share |
|---|---:|---:|
| Quotes | 42,905,444,709 | 7.7% |
| Orders | 287,847,312,166 | 51.8% |
| Trades | 225,101,951,708 | 40.5% |

</details>

The file names are Chinese; the field names are English. The three schemas should not be concatenated into one table.

```text
YYYYMMDD/
  行情.parquet
  逐笔委托.parquet
  逐笔成交.parquet
manifests.parquet
```

<details>
<summary><strong>Field reference</strong></summary>

**Quotes:** `wind_code`, `ex_code`, `date`, `time`, `price`, `volume`, `amount`,
`num_trades`, `iopv`, `trade_flag`, `bs_flag`, `cum_volume`, `cum_amount`, `high`, `low`,
`open`, `prev_close`; `ask_px1..10`, `ask_vol1..10`, `bid_px1..10`, `bid_vol1..10`;
`wavg_ask_px`, `wavg_bid_px`, `tot_ask_vol`, `tot_bid_vol`;
`idx_unweighted`, `n_sym`, `n_up`, `n_down`, `n_flat`.

**Orders:** `wind_code`, `ex_code`, `date`, `time`, `order_id`, `ex_order_id`,
`order_type`, `order_code`, `price`, `volume`.

**Trades:** `wind_code`, `ex_code`, `date`, `time`, `trade_id`, `trade_code`,
`order_code`, `bs_flag`, `price`, `volume`, `ask_order_id`, `bid_order_id`.

</details>

- Market-file `date` is uint32 `YYYYMMDD`. Manifest `date` is a **string**.
- `time` is uint32 `HHMMSSmmm`: `103807810` means 10:38:07.810, **Asia/Shanghai**.
- IDs are uint64. Numeric payload fields use DOUBLE. Empty source fields become NULL.
- Text is generally Arrow `large_string`; some early files use `string`. Cast when needed before concatenation.

### Read before calculating features

**Venue attribution.** Do not infer the exchange from the `.SH` or `.SZ` suffix.
Shanghai ETFs, bonds and other non-stock instruments can carry `.SZ` in this export.
For example, Shanghai-listed `510300` appears as `510300.SZ`.
On 2026-08-28, **23.3% of order rows** had a `.SZ` suffix but Shanghai-style message codes.
`ex_code` is a security code, not a venue identifier. Use a date-appropriate instrument reference.
Some dates, including 2017-12-01, use lowercase suffixes; case normalization does not fix venue attribution.

**Historical order coverage.** Shanghai stock-order messages enter this archive on **2021-07-23**.
Do not treat the earlier absence as zero order activity. A measured suffix-bucket comparison follows;
it is not a clean venue census, and the July 22 files start late in the session.

| Order rows by suffix bucket | 2021-07-22 | 2021-07-23 |
|---|---:|---:|
| `.SH` | 0 | 44,650,953 |
| `.SZ` | 60,126,847 | 86,185,512 |

**Cancellation and order codes.** Apply venue-specific rules:

| Venue | Cancellation stream | Code |
|---|---|---|
| Shanghai | Orders / 逐笔委托 | `order_type = 'D'` |
| Shenzhen | Trades / 逐笔成交 | `trade_code = 'C'` |

Shenzhen publishes original orders; Shanghai order messages can describe the remainder after fills.
For **Shenzhen limit orders**, include `order_type IN ('0','2')`: this export uses both encodings.
A `'0'`-only filter can remove entire sessions, including 2024-06-17.
On 2022-08-19 the encoding changes within the day; do not hard-code an unverified crossover time.
The `order_code` field uses `B` / `S` for direction.

**Prices and invalid values.** Divide stock prices and quote-price levels by **10,000** to obtain CNY.
For example, `12,978,900` means **1,297.89 CNY**. This conversion does not establish the units of
`amount`, `iopv` or other derived fields. Unsigned representations of negative/sentinel values can appear
as huge positive numbers in numeric columns. Check magnitudes before computing means or notionals.

**Identity and reconstruction.** Order and trade IDs are sequence identifiers, not accounts or brokers.
They can support lifecycle matching where the required messages exist. This vendor archive does not guarantee
lossless order-book reconstruction or complete queue positions. It has no exchange-feed receive timestamps.

### Session coverage: inspect the recorded times

The table below reports **full-market manifest observations for 2026-08-28**. These are earliest/latest records, not exchange session schedules.

| Stream | First recorded time | Last recorded time |
|---|---|---|
| Quotes | 08:00:00.000 | 15:00:58.911 |
| Orders | 08:33:44.320 | 15:00:58.992 |
| Trades | 09:15:00.010 | 15:00:58.992 |

All times are Asia/Shanghai. Orders can include pre-auction records.
Other dates have missing session prefixes: on **2021-07-22**, all three streams start around **09:48:05**.
Passing conversion checks does not establish full-session coverage. Inspect each date and symbol before
auction, event-window or book-reconstruction research.

### Download size by year

Average compressed size of **all three streams per included trading day**, in decimal GB.
These numbers summarize the historical manifest, not just the uploaded subset.


<img src="assets/v3_download_en_light.svg" alt="Annual mean compressed size: 0.95 GB/day in 2017 and 6.46 GB/day in 2026 through August." width="624" class="chart chart-light dark:hidden" />
<img src="assets/v3_download_en_dark.svg" alt="Annual mean compressed size: 0.95 GB/day in 2017 and 6.46 GB/day in 2026 through August." width="624" class="chart chart-dark hidden dark:block" />

<details>
<summary><strong>Exact average download sizes</strong></summary>

| Year | Average GB/day |
| --- | ---: |
| 2017 | **0.95** |
| 2018 | **0.93** |
| 2019 | **1.18** |
| 2020 | **1.77** |
| 2021 | **2.46** |
| 2022 | **3.05** |
| 2023 | **2.91** |
| 2024 | **3.52** |
| 2025 | **4.44** |
| 2026² | **6.46** |

</details>

² 2026 through August. The 2026-08-28 example day totals **5.89 GB**; it is below the 2026 average.
For scale, the full 2017 manifest year totals **231.77 GB**, while 2025 totals **1,079.28 GB**.

### Message volume over time

<img src="assets/v3_activity_en_light.svg" alt="Annual average rows by stream; all three series share one scale, in millions per trading day." width="624" class="chart chart-light dark:hidden" />
<img src="assets/v3_activity_en_dark.svg" alt="Annual average rows by stream; all three series share one scale, in millions per trading day." width="624" class="chart chart-dark hidden dark:block" />

<details>
<summary><strong>Exact annual mean message counts</strong></summary>

**Millions of rows per trading day, annual means.** Trades-stream rows include Shenzhen cancellations;
they are not all executions. The Shanghai order-coverage change affects the 2021 comparison.

| Year | Quotes | Orders | Trades |
| --- | ---: | ---: | ---: |
| 2017 | 10.3 | 19.7 | 26.9 |
| 2018 | 10.5 | 19.5 | 26.5 |
| 2019 | 12.5 | 29.6 | 39.7 |
| 2020 | 15.2 | 49.2 | 63.6 |
| 2021 | 17.0 | 92.8 | 91.7 |
| 2022 | 19.8 | 142.9 | 113.9 |
| 2023 | 20.9 | 140.1 | 103.3 |
| 2024 | 24.7 | 200.1 | 133.4 |
| 2025 | 26.8 | 255.9 | 172.9 |
| 2026² | 28.9 | 359.2 | 236.4 |

² 2026 through August. These are annual means, not rolling averages.

</details>

### Query performance

Rows are clustered by `wind_code`, and the sampled files have row-group min/max statistics.
Symbol filters can therefore skip most row groups. A prior measurement for **600519 on 2026-08-28**:

| Stream | Whole-file size | Read after pruning |
|---|---:|---:|
| Orders | 2,432 MB | 9.1 MB |
| Trades | 2,105 MB | 15.4 MB |
| Quotes | 1,349 MB | 57.9 MB |

These are sample measurements, not download-size guarantees. `hf_hub_download` downloads the full file.
Remote query engines may use range requests. Pruning varies with date, stream, columns and query engine;
earlier files often have fewer row groups. Check Parquet footers rather than assuming every payload column
has statistics. A prefix filter such as `wind_code LIKE '600519%'` also matches lowercase-suffix dates.

### Quality checks and known gaps

The ledger contains **2,346 rows and 77 columns**. All indexed dates passed the conversion pipeline's five checks:

| Gate | Check |
|---|---|
| G0 | Source listing fingerprint |
| G1 | File inventory |
| G2 | Partition integrity |
| G3 | Row reconciliation with the vendor export |
| G4 | Conversion semantic checks |

These checks concern the **conversion**, not independent completeness against exchange records.
The ledger includes source sizes, row counts, instrument counts, observed time ranges, repairs and the original JSON record.
Source-archive SHA-256 hashes exist for **2,295 dates**; **51 are missing**.

| Repair | Affected dates¹ | Amount |
|---|---:|---:|
| Drop `date=0` filler | 203 | 17,287,885 rows |
| Restore dates on real payloads | 285 | 15,783,503 rows |
| Strip embedded NUL bytes | 11 | 677,759,395 bytes |
| Drop stray-date duplicate rows | 1 | 1,057,825 rows |
| Drop extra trailing columns | 5 | See ledger |

¹ Distinct dates across streams; categories can overlap. The stray-date repair affects the **2020-02-25 archive**,
which contained duplicate rows dated 2020-02-28. Do not sum these date counts as a unique total.

<details>
<summary><strong>Repair fields and a local ledger query</strong></summary>

Fields use the prefix `streams_<stream>_`, where stream is `行情`, `逐笔委托` or `逐笔成交`.
Only stream/repair combinations that occurred have a column.

| Suffix | Meaning |
|---|---|
| `date0_sentinel_junked` | Dropped filler rows |
| `date0_repaired` | Restored payload dates |
| `nul_bytes_stripped` | Removed NUL bytes |
| `stray_date_rows_dropped_20200228` | Dropped 2020-02-28 rows from the 2020-02-25 archive |
| `extra_tail_cols_dropped` | Removed trailing fields |

Run this after the Quickstart's ledger download:

```python
import duckdb
con = duckdb.connect()
con.register("ledger", ledger)
print(con.sql("""
    SELECT count(*) AS days,
           count(*) FILTER (WHERE gates_all_green) AS passed_conversion,
           count("7z_sha256") AS source_hashes,
           min(date) AS first_day, max(date) AS last_day
    FROM ledger
""").fetchall())
# Historical snapshot: 2346, 2346, 2295, '20170103', '20260831'
```

`lean_stats_deferred=true` does not mean the shipped files lack statistics.
`fingerprint_col_counts_行情` counts the source CSV header, not the shipped quote schema.
Read the Parquet footers for actual field types and statistics.

</details>

### Updates and terms

New trading days are converted and uploaded at T+1. `manifests.parquet` is regenerated less often,
so the ledger's last day can trail the newest directories.
There is **no guaranteed daily delivery time**. Enumerate the directories rather than assuming a
date range is present.

For academic and non-commercial research only; see [LICENSE](LICENSE).
Rights in the underlying market data remain with their respective owners. The repository license covers compilation,
cleaning and documentation, not ownership of the source market data. No warranty of fitness applies.
Do not use this archive as the sole basis for trading decisions. Rights holders can contact the maintainer through repository discussions.

---

## 中文说明

### 这份数据包含什么

这是一份中国证券市场 Level-2 历史数据归档，来自供应商的历史导出，按交易日保存为 Parquet。
你可以读取**十档行情快照、逐笔委托消息和逐笔成交记录**，研究盘口、订单流及成交行为。
逐笔成交文件中还包含深圳市场的撤单记录，因此**消息行数不等于成交笔数**。

收录范围不仅有 A 股，也有 ETF、债券、回购等非股票品种。文件中的证券数量不能当作 A 股股票数量。
<!-- AUTO:intro-zh -->
线上覆盖 **2017-01-03 至 2026-11-20**，共 **2,399 个交易日、5,849.24 亿行消息、6.48 TB 压缩文件**，
每个交易日三份文件齐全。
<!-- /AUTO:intro-zh -->

### 现在能下载多少

<!-- AUTO:coverage-zh -->
**全部。** 2017-01-03 至 2026-11-20 共 **2,399 个交易日**都已上线且三份文件齐全，合计 **7,197 份 Parquet、6.48 TB** 压缩体积，没有任何一天是残缺的。

这里的“齐全”只表示三份文件都存在，**不代表整天的每条消息都完整**。

| 年份 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026¹ |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| 交易日 | 244 | 243 | 244 | 243 | 243 | 242 | 242 | 242 | 243 | 213 |

¹ 2026 年统计至 11 月 20 日。
<!-- /AUTO:coverage-zh -->

### 如何开始使用

**本仓库需申请访问。** 两步：点页面右上角 ♥ Like，并关注作者 [@venvoo](https://huggingface.co/venvoo)，
然后点 **Request access**。机器人持续核对，两步齐备后数秒内自动放行；缺任一步申请会一直挂起，且不会有任何通知。
下载时需要先 `hf auth login`（已放行账号的任意 read token 即可）。

建议先下载约 **900 KB** 的 `manifests.parquet`，核对日期和转换记录，再下载大文件。
[上方 Quickstart](#quickstart) 提供可直接运行的安装、清点、下载和查询代码。

- **清点代码**固定同一个提交版本，分别统计清单内的日期与清单之外的新日期。
- **单股票示例**先下载整份逐笔委托文件，再按股票代码读取。示例日整份文件约 **2.43 GB**，不是只下载这一只股票。
- **DuckDB 远程查询**可以利用行组统计跳过部分内容，但仍会产生网络请求；反复研究同一批日期，建议下载后本地查询。
- **复现实验**需要保存并引用提交 SHA。直接使用不断变化的 `main`，不能保证之后得到同一份数据。

### 文件结构与字段

| 文件 | 含义 | 列数 |
|---|---|---:|
| **行情.parquet** | 十档行情快照，每个证券通常约 3 秒一条 | **66** |
| **逐笔委托.parquet** | 委托消息；撤单在哪个文件取决于交易所 | **10** |
| **逐笔成交.parquet** | 成交消息，以及深圳市场的撤单记录 | **12** |

<img src="assets/v3_streams_zh_light.svg" alt="历史归档消息占比：逐笔委托51.8%，逐笔成交40.5%，行情7.7%。" width="624" class="chart chart-light dark:hidden" />
<img src="assets/v3_streams_zh_dark.svg" alt="历史归档消息占比：逐笔委托51.8%，逐笔成交40.5%，行情7.7%。" width="624" class="chart chart-dark hidden dark:block" />

逐笔成交流包含深圳撤单，不全是真实成交。

<details>
<summary><strong>展开各类消息行数</strong></summary>

| 消息流 | 行数 | 比例 |
|---|---:|---:|
| 行情 | 42,905,444,709 | 7.7% |
| 逐笔委托 | 287,847,312,166 | 51.8% |
| 逐笔成交 | 225,101,951,708 | 40.5% |

</details>

每个交易日一个目录，三份文件各用自己的字段结构，不能直接上下拼成一张表。
文件名为中文，字段名为英文。根目录的 `manifests.parquet` 是按日转换清单。

<details>
<summary><strong>展开字段说明</strong></summary>

**行情：** 证券代码、日期、时间、价格、成交量/额，以及 `ask_px1..10`、`ask_vol1..10`、
`bid_px1..10`、`bid_vol1..10` 四组十档字段。还包括累计量额、开高低、昨收、加权价及部分指数统计字段。
英文版的 Field reference 保留完整字段列表。

**逐笔委托：** `wind_code`、`ex_code`、`date`、`time`、`order_id`、`ex_order_id`、
`order_type`、`order_code`、`price`、`volume`。

**逐笔成交：** `wind_code`、`ex_code`、`date`、`time`、`trade_id`、`trade_code`、
`order_code`、`bs_flag`、`price`、`volume`、`ask_order_id`、`bid_order_id`。

</details>

- **日期：** 行情文件中的 `date` 为 uint32，格式 `YYYYMMDD`；清单中的 `date` 为字符串。
- **时间：** `time` 为 uint32，格式 `HHMMSSmmm`。例如 `103807810` 表示 **10:38:07.810**，时区为上海。
- **类型：** 订单和成交标识为 uint64；数值载荷为 DOUBLE；原始空字段为 NULL。文本通常为 `large_string`，部分早期日期为 `string`。

### 使用前必须了解的口径

**证券后缀不能确定交易所。** 部分上交所 ETF、债券等品种在这份导出里也带 `.SZ`，
例如上交所 ETF `510300` 以 `510300.SZ` 出现。
2026-08-28 的委托消息中，**23.3%** 带 `.SZ` 后缀，却使用上交所消息编码。
`ex_code` 同样只是证券代码，不是交易所编号。请使用与日期匹配的证券名录。
部分日期的后缀为小写；统一大小写只能解决文本匹配，不能修复交易所归属。

**上海逐笔委托有历史起点。** 本归档从 **2021-07-23** 开始出现上海股票的逐笔委托。
此前缺失不能解释为没有委托活动。跨越这一天比较订单流时，要区分交易所和覆盖变化。
英文版保留了相邻日期按后缀分组的行数；该分组不等于干净的交易所分组，而且前一天的文件还缺少早盘前段。

**撤单和限价单需要按交易所解码。**

| 交易所 | 撤单所在文件 | 判断字段 |
|---|---|---|
| 上海 | 逐笔委托 | `order_type = 'D'` |
| 深圳 | 逐笔成交 | `trade_code = 'C'` |

深圳发布原始委托，上海消息可能描述部分成交后的剩余委托。
筛选**深圳限价单**时需兼容 `order_type IN ('0','2')`。
仅保留 `'0'` 会漏掉某些整天的数据，例如 2024-06-17。
2022-08-19 存在日内编码切换，不应把未经确认的具体切换时刻写死。方向字段 `order_code` 使用 `B` / `S`。

**股票价格需要除以 10,000。** 例如 `12,978,900` 对应 **1,297.89 元**，盘口价位同样需要换算。
不要把这个比例直接套到 `amount`、`iopv` 等未核实字段。
负数或哨兵值可能以无符号形式存储，读成异常大的正数；计算均值、金额前要检查取值范围。

**标识不是投资者身份。** 订单号、成交号及买卖方订单关联号是序列标识，不能识别账户、券商或个人。
只有相关消息确实存在时，才可能做订单生命周期匹配。供应商归档不保证无损盘口重建，也没有接收时间戳或完整队列位置。

### 日内覆盖不能只看文件是否存在

下表是 **2026-08-28 全市场清单记录的最早和最晚时间**，不是交易所的开收盘日程。

| 消息流 | 最早记录 | 最晚记录 |
|---|---|---|
| 行情 | 08:00:00.000 | 15:00:58.911 |
| 逐笔委托 | 08:33:44.320 | 15:00:58.992 |
| 逐笔成交 | 09:15:00.010 | 15:00:58.992 |

以上均为上海时间。委托文件可能包含集合竞价开始前的记录。
另一些日期缺少交易时段开头的一段记录，例如 **2021-07-22** 三类消息都从约 **09:48:05** 才开始。
转换校验通过，不等于全天覆盖完整。研究集合竞价、事件窗口和盘口重建时，请逐日、逐证券核对。

### 下载体积要按年份估算

下表统计历史清单中，**每个交易日三类压缩文件合计的平均体积**。
GB 使用十进制，不等同于 GiB；2026 年只到 8 月底。


<img src="assets/v3_download_zh_light.svg" alt="三类文件合计日均压缩体积：2017年0.95GB，2026年前八个月6.46GB。" width="624" class="chart chart-light dark:hidden" />
<img src="assets/v3_download_zh_dark.svg" alt="三类文件合计日均压缩体积：2017年0.95GB，2026年前八个月6.46GB。" width="624" class="chart chart-dark hidden dark:block" />

<details>
<summary><strong>展开各年日均下载体积</strong></summary>

| 年份 | 日均压缩体积 GB |
| --- | ---: |
| 2017 | **0.95** |
| 2018 | **0.93** |
| 2019 | **1.18** |
| 2020 | **1.77** |
| 2021 | **2.46** |
| 2022 | **3.05** |
| 2023 | **2.91** |
| 2024 | **3.52** |
| 2025 | **4.44** |
| 2026² | **6.46** |

</details>

² 2026 年只到 8 月底。示例日 2026-08-28 合计 **5.89 GB**，不能代表整个 2026 年的均值。
2017 全年合计 **231.77 GB**；2025 全年合计 **1,079.28 GB**。

### 三类消息的规模变化

<img src="assets/v3_activity_zh_light.svg" alt="三类消息共用同一刻度：每交易日日均百万行，按年度取均值。" width="624" class="chart chart-light dark:hidden" />
<img src="assets/v3_activity_zh_dark.svg" alt="三类消息共用同一刻度：每交易日日均百万行，按年度取均值。" width="624" class="chart chart-dark hidden dark:block" />

<details>
<summary><strong>展开各年日均消息量</strong></summary>

**单位：百万行/交易日，按年取平均。** 逐笔成交流包含深圳撤单，所以不能把这一列当作真实成交笔数。
2021 年上海委托覆盖变化会影响年度对比。

| 年份 | 行情 | 逐笔委托 | 逐笔成交 |
| --- | ---: | ---: | ---: |
| 2017 | 10.3 | 19.7 | 26.9 |
| 2018 | 10.5 | 19.5 | 26.5 |
| 2019 | 12.5 | 29.6 | 39.7 |
| 2020 | 15.2 | 49.2 | 63.6 |
| 2021 | 17.0 | 92.8 | 91.7 |
| 2022 | 19.8 | 142.9 | 113.9 |
| 2023 | 20.9 | 140.1 | 103.3 |
| 2024 | 24.7 | 200.1 | 133.4 |
| 2025 | 26.8 | 255.9 | 172.9 |
| 2026² | 28.9 | 359.2 | 236.4 |

² 2026 年只到 8 月底。这里使用年度均值，不是移动均值。

</details>

### 查询性能

文件按 `wind_code` 聚集排列，抽查文件的行组带有最小/最大值统计。
按证券筛选时，查询引擎可以跳过许多不相关的行组。
此前对 **2026-08-28 的 600519** 做过如下测量：

| 文件 | 整份大小 | 行组裁剪后读取量 |
|---|---:|---:|
| 逐笔委托 | 2,432 MB | 9.1 MB |
| 逐笔成交 | 2,105 MB | 15.4 MB |
| 行情 | 1,349 MB | 57.9 MB |

这些是特定日期、证券和查询的测量，不是所有下载都会达到的结果。
`hf_hub_download` 下载整份文件；支持范围请求的远程查询引擎才可能只读取部分字节。
不同年份、字段和行组划分会改变裁剪效果。实际类型与统计信息请看 Parquet 文件尾部元数据。

### 质量检查、修复与局限

历史清单有 **2,346 行、77 列**，所有列入清单的日期都通过了转换流程中的检查：

| 检查 | 内容 |
|---|---|
| G0 | 原始文件列表指纹 |
| G1 | 文件清点 |
| G2 | 分区完整性 |
| G3 | 与供应商导出的行数核对 |
| G4 | 转换语义检查 |

这些检查核对的是**供应商导出到 Parquet 的转换**，不等于与交易所独立核对过所有消息。
清单还记录文件体积、行数、证券数、观测时间范围、修复记录和原始 JSON。
**2,295 天有源压缩包 SHA-256，另有 51 天缺失**，不能声称每天都有完整哈希链。

| 修复类型 | 涉及日期数¹ | 数量 |
|---|---:|---:|
| 丢弃 `date=0` 填充记录 | 203 | 17,287,885 行 |
| 恢复有效记录的缺失日期 | 285 | 15,783,503 行 |
| 去除嵌入的 NUL 字节 | 11 | 677,759,395 字节 |
| 丢弃混入的异日重复记录 | 1 | 1,057,825 行 |
| 去除多余尾列 | 5 | 见清单 |

¹ 日期数按三类流合并去重，不同修复类型之间可能重叠，不能相加得到总受影响天数。
异日重复记录问题出在 **2020-02-25 的归档**，里面混入了日期为 2020-02-28 的重复行。
修复字段及查询示例见英文版的 Repair fields。

`lean_stats_deferred=true` 不能用来判断已发布文件是否没有统计信息。
`fingerprint_col_counts_行情` 记录原始 CSV 表头列数，不是最终 Parquet 列数；行情文件实际为 **66 列**。

### 更新方式与使用条款

新交易日在 T+1 转换并上传；`manifests.parquet` 重新生成的频率更低，清单截止日会落后于最新目录。
**不保证每日固定时间交付。** 使用前请按目录清点，不要假定某个日期区间一定齐全。

仅供学术与非商业研究，具体条款见 [LICENSE](LICENSE)。
底层行情数据权利仍属于相应权利人；仓库许可证只覆盖汇编、清洗和文档工作，不代表对源行情数据拥有全部权利。
数据按现状提供，不保证适合某一用途，也不应成为交易决策的唯一依据。
权利人如有疑问，可通过仓库讨论区联系维护者。

## Citation / 引用

```bibtex
@misc{ashare_l2_2026,
  title        = {{China A-Share Full-Market Level-2 Order Book and Tick Archive (2017--2026)}},
  author       = {{venvoo}},
  year         = {2026},
  publisher    = {{Hugging Face}},
  howpublished = {\url{https://huggingface.co/datasets/venvoo/china-a-share-l2-level2-limit-order-book-tick-data}},
  note         = {Dataset. Cite the repository commit used for the experiment.}
}
```
