跳到主要內容

獲取保證金比例

該接口用於獲取股票初始保證金比例、維持保證金比例、強平保證金比例。

SDK Links

Python
longport.openapi.TradeContext.margin_ratio
Rust
longport::trade::TradeContext#margin_ratio
Go
TradeContext.MarginRatio
Node.js
TradeContext#marginRatio

Request

HTTP MethodGET
HTTP URL/v1/risk/margin-ratio

Parameters

Content-Type: application/json; charset=utf-8

NameTypeRequiredDescription
symbolstringYES股票代碼,使用 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

StatusDescriptionSchema
200返回成功margin_ratio_rsp
400內部錯誤None

Schemas

margin_ratio_rsp

NameTypeRequiredDescription
im_factorstringtrue初始保證金比例
mm_factorstringtrue維持保證金比例
fm_factorstringtrue強平保證金比例