QKA 框架
SkillDev toolsGenerates A-share quantitative backtest strategies, stock selection, and technical indicator code using the QKA (Kuai Quant) framework. Use this skill when writing quantitative code based on APIs such as qka.Data, qka.Strategy, qka.Backtest, and qka.Broker.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the QKA 框架 skill
What this skill tells your AI
The instructions your AI receives, as published by zsrl/qka in skills/qka/SKILL.md and read by ahel’s review.
简洁易用的 A 股量化回测框架,共七个公开类:
| 类 | 全限定名 | 作用 |
|---|---|---|
| Data | qka.Data | 行情数据加载 + 指标预计算 |
| Simulate | qka.Simulate | 模拟标的 — 描述一只由 qka 现场生成的行情 |
| Strategy | qka.Strategy | 策略基类 — 实现 on_bar 做交易决策 |
| Broker | qka.Broker | 虚拟券商 — 执行买卖,管理资金和持仓 |
| SizingAccessor | qka.SizingAccessor | 仓位计算 — 四种仓位方法 |
| Backtest | qka.Backtest | 回测引擎 — 串联 Data 和 Strategy,注入基础设施 |
| Analysis | qka.Analysis | 分析模块 — 常用的分析方法 |
参考文档
详细 API 文档按模块拆分在 references/ 目录下,按需查阅对应文件:
| 模块 | 文件 | 内容 |
|---|---|---|
| Data | references/data.md | 数据加载、指标预计算(ta 库全部指标 + qka 内置指标)、get() |
| Simulate | references/data.md | 模拟标的:Simulate(symbol, drift, reversion, vol),放进 Data(symbols=[...]) |
| Strategy | references/strategy.md | 策略基类、on_bar、self.get()、self.history() |
| Backtest | references/backtest.md | run()、bt.metrics、bt.results、bt.trade_history |
| Broker | references/broker.md | buy()、sell() |
| SizingAccessor | references/sizing.md | 四种仓位方法 |
| Analysis | references/analysis.md | zigzag()、alpha_beta()、sharpe_ratio()、max_drawdown()、information_ratio() |
使用指南
- 编写回测策略:读
references/strategy.md+references/backtest.md,必要时读references/data.md - 编写选股 / 数据加载:读
references/data.md - 使用买卖 / 仓位:读
references/broker.md+references/sizing.md - 使用事后分析:读
references/analysis.md
Signals
- GitHub stars
- 111
- Forks
- 35
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
qka- Source
- github.com/zsrl/qka