quant-finance
Run and troubleshoot RD-Agent quantitative-finance factor and model workflows backed by Qlib, including factor-report and co-optimization loops.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- quant-finance
- license
- MIT
- metadata
- { "disco-role": "operating", "parent-skill": "rd-agent" }
- description
- Run and troubleshoot RD-Agent quantitative-finance factor and model workflows backed by Qlib, including factor-report and co-optimization loops.
- disable-model-invocation
- true
02 资源文件 2
- 参考文档references/qlib-contract.md1.3 KB
- 脚本scripts/check_qlib_data.py803 B
03 SKILL.md 正文
RD-Agent quantitative finance
Use this sub-skill for RD-Agent(Q), factor generation, factor reports, Qlib model research, finance data-agent/model-agent loops, and backtest interpretation.
Choose the workflow
rdagent fin_quantis the finance quant agent entry point for factor/model co-optimization.rdagent fin_factor_reportis the inspected CLI entry point for factor-report-driven workflows. Run--helpin the active version before using it; older documentation may call the flowfin_factor.- Read the Qlib experiment templates and the active scenario config before changing dates, provider paths, model, or evaluator settings.
A typical safe sequence is:
rdagent fin_quant --help
rdagent fin_factor_report --help
# inspect the resolved configuration and data path
# run a tiny/debug iteration before a full loop
Data and split contract
The documented defaults use local Qlib data (commonly ~/.qlib/qlib_data/cn_data), the CSI300 universe, and SH000300 as benchmark. The reference templates use chronological splits around 2008–2014 for training, 2015–2016 for validation, and 2017–2020 for test/backtest. Treat those values as template evidence, not universal defaults: record the actual provider URI, market, benchmark, dates, and timezone used by the run.
Factor-agent loop:
- formulate a financially motivated hypothesis;
- implement a factor with a name, description, formula, and variables;
- evaluate it on the configured data;
- combine new factors with the baseline feature set and run the model/backtest;
- inspect signal and portfolio records;
- use feedback to refine the next hypothesis.
Model-agent loop follows the same evidence discipline but may read a report/paper and generate model code. Do not compare runs if the universe, date split, transaction costs, or evaluator changed.
Backtest hygiene
- Check chronological ordering and fit/validation/test boundaries before evaluating.
- Record the feature source, missing-value/normalization pipeline, model seed,
n_jobs, device, and transaction-cost assumptions. - Treat
SignalRecord, signal analysis, and portfolio analysis as separate artifacts. - Investigate leakage, survivorship bias, look-ahead features, and accidental test-set use before celebrating a metric.
- A generated factor that imports successfully is not a validated factor; require evaluator output and a reproducible artifact.
Read qlib-contract.md for the template/data/evaluation contract. Use the parent troubleshooting guide for provider, generated-code, and evaluator failures.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).