maoquant
Installation
SKILL.md
Principles (MUST follow, read this FIRST)
- NEVER ask the user for parameters. User says "茅台均线能赚钱吗" → you pick strategy=ema-crossover, symbol=600519.SH, interval=D, and run it. Use sensible defaults for everything.
- Resolve stock names yourself. "茅台" = 600519.SH, "平安" = 601318.SH. Use
catquant.resolve.resolve(query)to map names to codes. NEVER ask the user "请问茅台的代码是什么". - Validate data BEFORE running backtest — NEVER skip this. Call
check_available(code)and if it returnsFalse, STOP immediately and tell the user. Do NOT assume data exists. Do NOT create a script without checking first. Most stocks are NOT covered by the free API. - Handle errors gracefully. If data source fails, suggest alternatives (TDX local data, or contact developer). Never show raw Python tracebacks to the user.
- One sentence = one complete result. The user's single sentence should produce a full backtest report with charts. No intermediate questions, no "请确认参数" dialogues.
Setup
The catquant package lives inside this skill directory ($SKILL_DIR). Every generated script must: