A Stock Analysis
A股实时行情与分时量能分析
Ptrade quantitative trading platform by 恒生电子 — cloud-hosted Python strategies with broker-grade execution for Chinese securities.
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
SkillHub CLI
skillhub install coderwpf/ptrade打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。
将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。
Ptrade is a professional quantitative trading platform by 恒生电子 (Hundsun). Strategies run on broker servers (intranet), providing low-latency execution. It uses an event-driven Python framework.
⚠️ Requires broker account with Ptrade access. Strategies run in broker's cloud — no internet access from within strategies. Cannot install pip packages; only built-in third-party libraries are available.
Backtest supports:
Trading (live) supports:
Default supports Level2 十档行情, some brokers provide free L2 逐笔数据.
| Asset | Min tick | Decimals |
|---|---|---|
| Stock | 0.01 | 2 |
| Convertible bond | 0.001 | 3 |
| LOF / ETF | 0.001 | 3 |
| Reverse repo | 0.005 | 3 |
| Stock index futures | 0.2 | 1 |
| Treasury futures | 0.005 | 3 |
| ETF options | 0.0001 | 4 |
⚠️ When using
limit_pricein order functions, price must match the correct decimal precision or the order will be rejected.
600570.SS
000001.SZ
000300.SS (沪深300)def initialize(context):
"""Required — called once at startup. Use for setting universe, benchmark, scheduling."""
g.security = '600570.SS'
set_universe(g.security)
def before_trading_start(context, data):
"""Optional — called before market open.
In backtest: runs at 8:30 each trading day.
In trading: runs immediately on first start, then daily at 9:10 (default, broker configurable)."""
log.info('Pre...
这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。
# Ptrade (恒生量化交易平台)
[Ptrade](https://ptradeapi.com) is a professional quantitative trading platform by 恒生电子 (Hundsun). Strategies run on **broker servers** (intranet), providing low-latency execution. It uses an event-driven Python framework.
> ⚠️ **Requires broker account with Ptrade access**. Strategies run in broker's cloud — no internet access from within strategies. Cannot install pip packages; only built-in third-party libraries are available.
## Supported markets & business types
**Backtest supports:**
1. 普通股票买卖 (单位:股)
2. 可转债买卖 (单位:张,T+0)
3. 融资融券担保品买卖 (单位:股)
4. 期货投机类型交易 (单位:手,T+0)
5. LOF基金买卖 (单位:股)
6. ETF基金买卖 (单位:股)
**Trading (live) supports:**
1. 普通股票买卖 (单位:股)
2. 可转债买卖 (T+0)
3. 融资融券交易 (单位:股)
4. ETF申赎、套利 (单位:份)
5. 国债逆回购 (单位:份)
6. 期货投机类型交易 (单位:手,T+0)
7. ETF基金买卖 (单位:股)
**Default supports Level2 十档行情**, some brokers provide free L2 逐笔数据.
### Price decimal rules
| Asset | Min tick | Decimals |
|---|---|---|
| Stock | 0.01 | 2 |
| Convertible bond | 0.001 | 3 |
| LOF / ETF | 0.001 | 3 |
| Reverse repo | 0.005 | 3 |
| Stock index futures | 0.2 | 1 |
| Treasury futures | 0.005 | 3 |
| ETF options | 0.0001 | 4 |
> ⚠️ When using `limit_price` in order functions, price must match the correct decimal precision or the order will be rejected.
## Stock code format
- Shanghai: `600570.SS`
- Shenzhen: `000001.SZ`
- Index: `000300.SS` (沪深300)
---
## Strategy lifecycle (event-driven)
```python
def initialize(context):
"""Required — called once at startup. Use for setting universe, benchmark, scheduling."""
g.security = '600570.SS'
set_universe(g.security)
def before_trading_start(context, data):
"""Optional — called before market open.
In backtest: runs at 8:30 each trading day.
In trading: runs immediately on first start, then daily at 9:10 (default, broker configurable)."""
log.info('Pre...A股实时行情与分时量能分析
A股模拟交易系统 - 数据爬取、存储、策略回测、模拟交易 / A-Share Paper Trading System - Data Fetch, Storage, Backtest, Simulation
Discover, install, update, or create the right skill when a workflow gap appears. Use when a task is repetitive, a role lacks a reliable procedure, an existing skill might save time, ClawHub search/install coul...
AI Automation Agency Blueprint