A Stock Analysis
A股实时行情与分时量能分析
Ptrade quantitative trading platform by 恒生电子 — cloud-hosted Python strategies with broker-grade execution for Chinese securities.
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/ptradeInspect 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.
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...
These signals come from indexed source analysis and may lag behind changes. Check the current source files.
# 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