强化学习交易策略助手
SkillCommerce & financeA-share reinforcement learning trading strategy. Triggered when the user says "强化学习", "reinforcement learning", "RL交易", "RL策略", "DQN交易", "PPO策略", or "智能体交易". Fetches data via cn-stock-data and designs RL trading environments and strategies. Supports both formal and brief output styles.
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 强化学习交易策略助手 skill
What this skill tells your AI
The instructions your AI receives, as published by aifinlab/finclaw in skills/a-share-reinforcement-trading/SKILL.md and read by ahel’s review.
数据获取
通过 cn-stock-data skill 获取数据:
- K线数据: 日线/分钟线序列
- 实时行情: 环境状态更新
- 账户数据: 持仓/资金/收益
分析工作流
Step 1: 交易环境设计
- 状态空间:价格序列+技术指标+持仓状态
- 动作空间:买入/卖出/持有(离散)或仓位比例(连续)
- 奖励函数:收益率/Sharpe/风险调整收益
- A股约束:T+1、涨跌停、手续费建模
Step 2: RL算法选择
- DQN:离散动作空间,适合简单买卖决策
- PPO/A2C:连续动作空间,适合仓位管理
- SAC:最大熵框架,探索与利用平衡好
- 多智能体RL:多股票组合的协同决策
Step 3: 训练与调优
- 经验回放:打破时序相关性
- 课程学习:从简单市场环境逐步增加复杂度
- 奖励塑形:避免稀疏奖励导致训练困难
- 超参数:学习率/折扣因子/网络结构搜索
Step 4: 策略评估与部署
- 样本外回测:未见过的市场数据测试
- 与基准策略对比:买入持有/均线策略
- 鲁棒性测试:不同市场状态下的表现
- 实盘模拟:Paper trading验证
Step 5: 输出报告
输出格式
formal 风格(研报级)
# RL交易策略报告
## 一、环境设计
| 组件 | 配置 |
|------|------|
## 二、训练结果
[学习曲线、收敛情况]
## 三、策略表现
[收益/Sharpe/回撤]
## 四、部署建议
[实盘注意事项]
brief 风格(快速分析)
## RL策略速览
- PPO算法,状态维度64
- 训练收敛,样本外Sharpe 1.8
- 年化收益 18%,最大回撤 12%
- 优于买入持有基准 +8%
参考 references/reinforcement-trading-guide.md 获取详细方法论与 A股实证研究。
使用示例
示例 1: 基本使用
# 调用 skill
result = run_skill({
"param1": "value1",
"param2": "value2"
})
示例 2: 命令行使用
python scripts/run_skill.py --input data.json
Signals
- GitHub stars
- 241
- Forks
- 38
- Last commit
- May 2026
Advanced
- Catalog kind
- skill
- Gateway key
a-share-reinforcement-trading- Source
- github.com/aifinlab/finclaw