joinquant-skill
JoinQuant API references, templates and a linter: the agent checks platform functions before it writes strategy code.
- 92 ★ on the repository
- Last commit
Extended access
Why this level
- The skill generates trading strategy code that is then run on the platform; the result must be checked by you.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/joinquant-skillDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The skill generates trading strategy code that is then run on the platform; the result must be checked by you.
This is third-party code. Review the repository files before installing.
What it does
joinquant-skill fixes a common agent failure in Cursor, Claude Code and Codex: they invent JoinQuant functions, mix research and backtest interfaces and forget fees and price adjustment. Inside are 14 topical references, about 294 KB of raw API documentation, five strategy templates and `scripts/api_search.py` for function lookup. Generation goes through `scripts/strategy_scaffold.py` and checking through `scripts/strategy_lint.py` with static code analysis. The rest: nine factor examples in `factors/`, a `factor_lab/` module with IC calculation and grouping, PDF research report import in `research_importer/` and the `jqskill_mcp` MCP server that exposes tools prefixed `jq_`.
Who it is for. Quant analysts and developers writing strategies for the JoinQuant platform with an agent who want fewer errors, invented functions and unchecked assumptions.
Good fit when
- An agent has to write an ETF rotation strategy for JoinQuant with a given pool and schedule.
- Finished strategy code should go through `python scripts/strategy_lint.py my_strategy.py --strict`.
- A PDF report describes a strategy idea and it must move into code through `research_importer`.
- You need a quick lookup of a JoinQuant function in the raw documentation file.
Not a fit when
- The platform is different: the references and linter target JoinQuant.
- You expect proof of returns: the linter checks code, not data timing, overfitting or fill feasibility.
- You want to run a strategy on a live account without separate checks: compilation, backtest and simulation happen on the JoinQuant side.
Example request
Write an ETF rotation strategy for JoinQuant: pool 510300.XSHG, 510500.XSHG and 159915.XSHE, 20-day momentum, Monday rebalancing.Limitations
The project checks code structure and some JoinQuant idioms but not strategy returns, and it does not replace cloud compilation, backtesting and simulation on the platform itself. Passing the linter only means the code avoided the current rules. The references age with the platform, so verify key calls against the official documentation. Tests do not touch the network by default, while akshare and jqdatasdk checks are enabled by flags. Python 3.10 or newer is required. The MIT license is stated in the README but not detected on the repository page. Last commit 9 November 2026.
How to disable. Remove the link or folder joinquant-skill from the client's skills directory and drop the joinquant-skill entry from the MCP configuration if you added it.
FAQ
How do I lint a JoinQuant strategy?
Run `python scripts/strategy_lint.py my_strategy.py --strict`. Fix the errors and warnings, then paste the code into the JoinQuant web editor and compile and backtest there.
How do I create a strategy skeleton?
`python scripts/strategy_scaffold.py --type rotation --security 510300.XSHG --hold-num 5 --output my_strategy.py` builds a rotation file. `--list` shows the available types.
How do I connect the MCP server?
Install `pip install "mcp[cli]"` and run `python -m jqskill_mcp.server`. Point `cwd` in the client config at the full repository.
Do tests need a JoinQuant account?
No. Tests run offline without an account by default, and online jqdatasdk checks are enabled by a separate flag.
How many templates are included?
Five: single stock, multi-factor, ETF rotation, momentum and mean reversion. They are starter code, not a validated strategy.
Discussion
No questions or reviews yet.
Related
SkillsSkill for the QMT terminal: turns a strategy description or research PDF into a daily factor backtest script
Thirteen skills for quantitative trading on China's A-share market: AKShare and BaoStock data, Backtrader and RQAlpha backtests, QMT and JoinQuant docs
Turns a trading strategy into rules, runs a backtest and reconciles orders and balances against an independent ledger.
MCP server for Claude Code: the agent designs alpha factors, backtests them on China A-shares and checks them for overfitting
InvestSkill gives an assistant 34 ready frameworks for analysing US stocks, from company valuation to portfolio risk
The local AKQuant MCP server: an agent looks up the API, checks a strategy file and backtests it on history, with no trading.
README in short
The document lists the agent errors the project covers and gives a module table with verification limits. It describes setup on Windows, macOS and Linux, MCP, tests and a split of evidence: what pytest and the linter prove and what they do not.
README badge
Original SKILL.md
--- name: joinquant-skill description: Generate accurate, runnable quantitative strategy code for the JoinQuant (聚宽) platform. Use this skill when the user asks to write a stock/ETF/futures backtest, paper-trading, or live-trading strategy on JoinQuant — the skill provides progressive-disclosure access to the complete JoinQuant API knowledge base (14 categories, 294KB official docs), 5 production-ready strategy templates (single-stock MA, multi-factor, ETF rotation, momentum, mean-reversion), and a lint tool that catches hallucinated APIs, future-function violations, and unset price-mode/slippage/commission. Chinese-friendly. Code generated by this skill should paste directly into the JoinQuant online editor without modification. --- # JoinQuant Skill Generate quantitative strategy code that runs on the JoinQuant platform without modification. ## When to Use This Skill Yes: - Stock backtest / paper trading / live trading on JoinQuant (聚宽) - ETF rotation, multi-factor stock selection, momentum, mean reversion strategies - Futures (期货) strategies on JoinQuant - Margin trading (融资融券) strategies - Strategy code review / lint to catch hallucinated APIs and future-function violations - Translating a strategy idea into JoinQuant API calls No: - Local data analysis without JoinQuant (use `jqdatasdk` directly, or pandas/numpy) - Strategy backtesting on other platforms (vectorbt, backtrader, vn.py — use those skills instead) - Pure machine learning model training (no JoinQuant-specific API needed) - Live trading on broker APIs other than JoinQuant simulated trading (CTP, Interactive Brokers, etc. need different skills) ## Default Mode Most user requests fall into one of three patterns. Detect the pattern first, then route: | Pattern | Trigger | Action | |---|---|---| | **Quick code** | "帮我写一个 X 策略" / "用聚宽实现 Y" | Pick template, fill in user-specific parts, return ready-to-paste code | | **API question** | "聚宽里 get_price 的 fq 参数是什么意思" / "set_option 都有哪些选项" | Load matching `references/XX-*.md` and answer based on it | | **Code review** | "帮我审一下我这段聚宽代码" / paste of existing code | Run mental `strategy_lint.py` against it (or actually call it), point out hallucinated APIs and missing safeguards | ## Progressive Disclosure: 14 API Categories DO NOT load all references at once (294KB total, would burn context). Pattern-match the user request and load only the relevant category file: | Category | Reference file | Triggered by keywords | |---|---|---| | 策略设置 | `references/01-strategy-setup.md` | initialize, set_benchmark, set_option, set_order_cost, set_slippage, run_daily, run_weekly, run_monthly | | 数据获取 | `references/02-data-getters.md` | get_price, attribute_history, history, get_current_data, get_fundamentals, get_money_flow, get_concept, get_industry | | jqlib 因子库 | `references/03-jqlib.md` | alpha101, alpha191, technical_analysis, jqfactor | | 数据处理 | `references/04-data-processing.md` | get_factor_values, calc_factor_history, neutralize, winsorize, standardlize |