獲取保證金比例
該接口用於獲取股票初始保證金比例、維持保證金比例、強平保證金比例。
SDK Links
Python |
Rust |
Go |
Node.js |
Request
HTTP Method | GET |
HTTP URL | /v1/risk/margin-ratio |
Parameters
Content-Type: application/json; charset=utf-8
Name | Type | Required | Description |
---|---|---|---|
symbol | string | YES | 股票代碼,使用 ticker.region 格式,例如:AAPL.US |
Request Example
from datetime import datetime
from longport.openapi import TradeContext, Config
config = Config.from_env()
ctx = TradeContext(config)
resp = ctx.margin_ratio("700.HK")
print(resp)
Response
Response Headers
- Content-Type: application/json
Response Example
{
"code": 0,
"data": {
"im_factor": "0.1",
"mm_factor": "0.1",
"fm_factor": "0.1"
}
}
Response Status
Status | Description | Schema |
---|---|---|
200 | 返回成功 | margin_ratio_rsp |
400 | 內部錯誤 | None |
Schemas
margin_ratio_rsp
Name | Type | Required | Description |
---|---|---|---|
im_factor | string | true | 初始保證金比例 |
mm_factor | string | true | 維持保證金比例 |
fm_factor | string | true | 強平保證金比例 |