Borrowing it
Nothing to install: this file belongs to songshuquant/ssquant. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/songshuquant/ssquant/main/AGENTS.mdgit clone --depth 1 https://github.com/songshuquant/ssquantWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/songshuquant/ssquant/agents-md)<a href="https://agentmods.dev/instructions/songshuquant/ssquant/agents-md"><img src="https://agentmods.dev/badge/instructions/songshuquant/ssquant/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/songshuquant/ssquant/agents-md"><img src="https://agentmods.dev/badge/instructions/songshuquant/ssquant/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01705 | $0.01705 |
| Opus 5.5 | $0.00682 | $0.00682 |
| Sonnet 5.5 | $0.00341 | $0.00341 |
| Haiku 4.5 | $0.00170 | $0.00170 |
Grade A, and why
ssquant AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SSQuant — AI Agent 项目上下文
Version: 0.4.6 License: MIT Language: Python 3.9-3.14
项目定位
SSQuant(松鼠Quant)是中国期货 CTP 专业量化交易与回测框架,支持一套代码三处运行:回测 / SIMNOW 仿真 / 实盘。
v0.4.6 核心变化:
- 价格双轨制:复权策略价映射真实价格,用真实价格计算回测指标
- 本地数据复权与连续合约映射修复,提升专业期货回测可信度
- 回测报告增强:复权信息、真实成交价、回测配置和关键指标更清晰
- AI Agent 后端更新为
backend.py+start_server.py,支持工作区、历史、报告元数据管理 - README / SKILL 已重写,面向用户和 AI Agent 解释完整框架
目录结构
ssquant/
├── api/
│ └── strategy_api.py # StrategyAPI(策略唯一入口)
├── backtest/
│ ├── backtest_core.py # 回测引擎主循环
│ ├── unified_runner.py # BACKTEST / SIMNOW / REAL_TRADING 统一入口
│ ├── live_trading_adapter.py # 实盘/SIMNOW 桥接
│ ├── backtest_results.py # 回测结果与权益曲线
│ ├── backtest_report.py # 文本/结构化报告
│ ├── html_report.py # HTML 报告
│ └── rollover_engine.py # 自动移仓
├── config/
│ ├── trading_config.py # 俱乐部数据账号、本地/CTP/SIMNOW/实盘账户配置
│ ├── config_helpers.py # get_config() 等配置生成逻辑
│ └── _server_config.py # data_server 连接配置
├── data/
│ ├── data_source.py # 数据源、缓存、真实价格映射
│ ├── api_data_fetcher.py # REST API + SQLite 缓存
│ ├── local_data_loader.py # 本地 SQLite 导入/加载
│ ├── local_adjust.py # 前复权/后复权
│ └── contract_mapper.py # 888/777 连续合约映射
├── ctp/py39~py314/ # CTP 二进制
├── pyctp/ # CTP 客户端封装
└── indicators/
examples/ # 策略示例,新手必须先跑通
ai_agent/ # AI 策略助手
046.MD # v0.4.6 更新文档
README.md # 项目介绍和使用说明
SKILL.md # 面向 Codex / Claude Code 的完整框架指南
关键约定
- 策略唯一入口:所有交易操作必须通过
StrategyAPI。 - 连续合约:当前约定只有
888(主力)和777(次主力),不要写000。 - 复权类型:
adjust_type='0'不复权 /'1'后复权 /'2'前复权。 - 价格双轨制:策略用复权价格产生信号,框架映射真实价格计算成交、盈亏、权益、回撤等回测指标。
- 数据模式:
data_source_mode='data_server':远程数据,需俱乐部账号。data_source_mode='local':本地 SQLite,免会员;TICK 回测必须使用本地模式。- 远程行情与会员鉴权统一通过
ssquant/data/sdk_client.py复用官方ssquantdata客户端;不要恢复旧/api/auth/verify、直接 IP HTTP/WS 或独立令牌缓存。 - SDK 0.1.4 与支持 resume_kline_v1 的服务端可按原序号补发:补齐期间暂停策略回调、更新缓存,RecoveryEvent 后等待新的实时触发;不补执行历史交易信号。无法证明完整时仍终止策略,历史快照不能提供恢复保证。
- 默认高性能写法:在
initialize(api)中用api.register_indicator()注册指标,strategy()中 O(1) 查表。 - examples 是重要保障:覆盖约 80% 常见期货策略类型,新手和 AI 写策略前都应先参考并跑通示例。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 114 lines · 1,705 tokens per session scan A c3bcb3c1ce59
ssquant AGENTS.md is an instructions file published in the GitHub repository songshuquant/ssquant (123 stars, last pushed 16d ago), licensed MIT. It adds 1,705 tokens to every session, about $0.0068 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-04.
ssquant AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ssquant AGENTS.mdsongshuquant/ssquant | Instructions file | 123 | 16d ago | MIT | A | 1,705 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |