策略列表
列出当前已认证用户所拥有的策略。结果按 created_at 降序排列(最新的在前)。
端点
GET /v1/strategies
权重: 2 鉴权: 必填(需签名)—— 参见 鉴权。
查询参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
status | enum<draft|deployed|paused|stopped|error> | 否 | 按生命周期状态过滤。 |
template_id | string | 否 | 按模板过滤,例如 tpl_grid。 |
limit | integer | 否 | 每页大小,范围 1–100,默认 20。 |
cursor | string | 否 | 上一次调用返回的不透明分页游标。参见 通用信息。 |
响应
{
"data": [
{
"id": "strat_8f2a1b",
"name": "BTC grid 1h",
"template_id": "tpl_grid",
"params": {
"grid_levels": 8,
"upper_price": "72000",
"lower_price": "60000",
"rebalance_threshold": "0.02"
},
"symbols": ["BTCUSDT"],
"timeframe": "1h",
"capital": "10000.00",
"leverage": 3,
"status": "deployed",
"deployed_at": "2026-04-29T08:00:00Z",
"created_at": "2026-04-28T15:30:00Z",
"updated_at": "2026-04-29T08:00:00Z",
"stats": {
"open_positions": 2,
"total_pnl": "184.32",
"total_trades": 47,
"win_rate": "0.638"
}
},
{
"id": "strat_3c91de",
"name": "ETH DCA daily",
"template_id": "tpl_dca",
"params": {
"interval": "1d",
"buy_amount": "100"
},
"symbols": ["ETHUSDT"],
"timeframe": "1d",
"capital": "5000.00",
"leverage": 1,
"status": "paused",
"deployed_at": "2026-04-15T00:00:00Z",
"created_at": "2026-04-14T10:12:00Z",
"updated_at": "2026-04-27T09:15:00Z",
"stats": {
"open_positions": 0,
"total_pnl": "62.10",
"total_trades": 12,
"win_rate": "0.583"
}
}
],
"next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wNC0xNFQxMDoxMjowMFoifQ"
}
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
data | array<object> | 策略对象列表。每个对象的 schema 参见 获取策略。 |
next_cursor | string|null | 传给下一次调用以获取下一页。没有更多页时为 null。 |
错误
400 INVALID_PARAMETER——limit超出范围、cursor格式错误,或status/template_id值非法。
完整列表参见 错误。
示例
curl -G "https://api.pipai.example/v1/strategies" \
--data-urlencode "status=deployed" \
--data-urlencode "limit=50" \
-H "X-PipAI-API-Key: $API_KEY" \
-H "X-PipAI-Timestamp: $TS" \
-H "X-PipAI-Signature: $SIG"