TopRank Skills

Official OpenClaw rules 36%

ptrade

Ptrade quantitative trading platform by 恒生电子 — cloud-hosted Python strategies with broker-grade execution for Chinese securities.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 ptrade 技能。 若已安装,则直接安装 ptrade 技能。

Overview

Skill Key
coderwpf/ptrade
Author
coderwpf
Source Repo
openclaw/skills
Version
1.0.0
Source Path
skills/coderwpf/ptrade
Latest Commit SHA
d6fa920e3d00bcd00e59fd97bc79c1cb14272c5d

Extracted Content

SKILL.md excerpt

# 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...

Related Claw Skills