跳到主要內容

获取保证金比例

该接口用于获取股票初始保证金比例、维持保证金比例、强平保证金比例。

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强平保证金比例