PTRADE Strategy Skill
OpenClaw Skill - 国金PTRADE量化平台策略生成,支持双均线、因子选股、日内交易等模板
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
Not yet listed on ClawHub or SkillsMP
// README
PTRADE Strategy Generator Skill
OpenClaw Skill — Generate ready-to-use quantitative trading strategies for the Guojin PTRADE platform.
English
Overview
This OpenClaw skill generates Python strategy code for the Guojin PTRADE quantitative trading platform (国金 PTRADE). It provides strategy templates, API references, and code generation based on your knowledge base documents stored in IMA.
Features
- Strategy Templates: Moving Average (MA), Financial Factor, Intraday Trading
- Full API Reference: Market data, trading functions, financial factors
- Code Generation: Generate complete strategies from templates in seconds
- Knowledge Base Integration: Reads documents from IMA
个人知识库 -> 国金量化
Installation
skillhub install ptrade-strategy
Usage
Trigger keywords: PTRADE, 量化策略, 量化交易, 生成策略
Example:
"帮我生成一个双均线策略" "Generate a financial factor stock selection strategy"
Included Templates
| File | Description |
|---|---|
templates/dual_ma_strategy.py | Dual Moving Average (Golden/Death Cross) |
templates/factor_strategy.py | Financial Factor Stock Selection |
templates/ma_strategy.py | Basic MA Strategy |
Strategy Parameters
| Parameter | Default | Description |
|---|---|---|
SECURITY | 000001.XSHG | Trading symbol (Code.Exchange) |
SHORT_WIN | 5 | Short MA period |
LONG_WIN | 20 | Long MA period |
PERIOD | 1d | K-line period: 1d daily, 60m, 5m |
STOP_LOSS_PCT | 5% | Stop loss threshold |
TAKE_PROFIT_PCT | 15% | Take profit threshold |
PTRADE API Reference
# Market data
security.get_bars(n, end_date, fields, count, period)
security.get_financial_data(start_date, end_date, count, fields)
security.get_index_stocks(index_code) # e.g. "000300.XSHG"
security.get_positions()
security.get_account_info()
# Trading
trade.open_long(security, volume, price, price_type)
trade.close_long(security, volume, price, price_type)
# price_type: "market" (open price), "latest" (requires live data)
# Supported: numpy, pandas, scipy, sklearn, statsmodels
How to Run in PTRADE
- Open PTRADE -> 策略研究 -> 新建策略
- Paste the generated code -> Save
- Backtest: Set date range and initial capital
- Optimize: Adjust SHORT_WIN / LONG_WIN
- Live: Enable auto-execution
中文说明
本 Skill 为国金 PTRADE 量化交易平台生成可运行的 Python 策略代码。
核心功能
- 策略模板:双均线、财务因子选股、日内交易
- API 参考:行情获取、下单函数、财务数据
- 代码生成:从模板快速生成完整策略
- 知识库集成:读取 IMA「个人知识库 -> 国金量化」中的官方文档
使用方式
触发关键词:PTRADE、量化策略、量化交易、生成策略
PTRADE 使用步骤
- 打开 PTRADE -> 策略研究 -> 新建策略
- 粘贴代码 -> 保存(Ctrl+S)
- 回测:设置时间范围和初始资金
- 参数优化:调整均线周期等参数
- 实盘运行:订阅策略,开启自动下单
注意事项
volume必须为 100 的整数倍(1手=100股)- 回测撮合默认以开盘价成交,需订阅实时行情才能用最新价
- 支持库:
numpypandasscipysklearnstatsmodels
Repository Structure
ptrade-strategy/
├── SKILL.md # Main skill file
├── kb_ref.md # Knowledge base document index
└── templates/
├── dual_ma_strategy.py # Dual MA strategy (recommended)
├── ma_strategy.py # Basic MA strategy
└── factor_strategy.py # Financial factor strategy
License
MIT