Search

PythonReactSEOPDF
OpenClaw

ptrade

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

coderwpf0 source installs☆ 0 Repository starsv1.0.0

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install coderwpf/ptrade

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

Ptrade (恒生量化交易平台)

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.

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)

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

Source information

Source
github
Repository
openclaw/skills
Path
skills/coderwpf/ptrade
Version
1.0.0
Commit
d6fa920e3d00bcd00e59fd97bc79c1cb14272c5d
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# 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 skills

OpenClaw

structure-thinking

caoyumin97

Structured problem analysis and communication using system mapping and hierarchical logic. Use when a request involves messy, multi-factor problems, root-cause analysis, intervention design, feedback loops or d...

OpenClaw

MarketPulse

chaimengphp

Query real-time and historical financial data across equities and crypto—prices, market moves, metrics, and trends for analysis, alerts, and reporting.

OpenClaw

kubera

bywallace

Read and manage Kubera.com portfolio data (net worth, assets, debts, allocation, holdings). Use when a user asks about their finances, net worth, portfolio, investments, holdings, asset allocation, or wants to...