05 / AI 项目启动05 / AI PROJECT STARTER

把数据说明直接交给 Codex 或 Claude。Give Codex or Claude the data context directly.

这是一份从完整回测说明整理出的项目启动提示词。它告诉 AI 如何检查文件、关联市场、模拟成交、避免未来数据泄漏,并建立第一版可复现回测项目。This project starter turns the full backtesting guide into an actionable prompt. It tells an AI tool how to inspect files, join markets, simulate fills, avoid look-ahead bias, and build a reproducible first version.

复制后怎么用How to use it

  1. 下载或复制下面的 Markdown 文件。Copy or download the Markdown file below.
  2. 打开 Codex、Claude Code 或其他代码工具。Open Codex, Claude Code, or another coding tool.
  3. 把文件全文粘贴进去,再告诉 AI 你的本地数据目录。Paste the full file, then provide the local data directory.
  4. 让 AI 先做文件清单和质量检查,再开始写策略。Ask the AI to inventory and validate the data before writing a strategy.

这份说明已经包含什么What the prompt includes

数据口径Data boundaries

明确这是盘口快照而不是逐笔成交,并写出数据能证明什么、不能证明什么。Separates order-book snapshots from trade-by-trade data and states what the dataset can and cannot prove.

文件和字段Files and schema

包含 live、hourly、daily 文件层次,以及 ticks、depth、outcomes、seen_markets 的字段和关联键。Covers live, hourly, and daily layers plus the fields and joins for ticks, depth, outcomes, and seen_markets.

成交模拟Fill simulation

规定买入从 ASK 消耗、卖出从 BID 消耗,并要求配置延迟、部分成交、费用和滑点。Defines ASK-side buys and BID-side sells, with explicit latency, partial fills, fees, and slippage.

质量和防泄漏Quality and leakage checks

要求检查窗口边界、断线、异常盘口、结算标签和未来数据泄漏。Requires checks for window boundaries, gaps, malformed books, outcome labels, and look-ahead bias.

建议一起提供Provide these alongside it

为了让 AI 直接开始工作,最好同时提供数据目录路径、一个小日期范围、你想测试的策略描述,以及希望使用的 Python 版本。For a smooth start, also provide the data directory, a small date range, the strategy you want to test, and your preferred Python version.

如果还没有策略,也可以先让 AI 只完成 inventory、schema 检查、成交模拟器和基准报告。If you do not have a strategy yet, ask the AI to build only the inventory, schema checks, fill simulator, and baseline report first.

先阅读网站上的回测方法Read the on-site backtesting method first