QMT · 内置 Python交易函数
get_enable_short_contract
获取信用账户当前可融券的明细
提示
注:由于字段m_dSloRatio、m_dSloStatus提供来源和取担保品明细(get_assure_contract)重复,字段在2021年9月移除,后续用担保品明细接口获取,具体见 担保标的对象字段说明在新窗口打开
用法
get_enable_short_contract(accId)
释义
获取信用账户当前可融券的明细
参数
- accId:信用账户
返回值
list,list 中放的是 CreditSloEnableAmount在新窗口打开,通过 dir(pythonobj) 可返回某个对象的属性列表。
示例
#coding:gbk
def init(ContextInfo):
pass
def handlebar(ContextInfo):
if not ContextInfo.is_last_bar():
return
obj = get_enable_short_contract('200133')
for i in obj[:3]:
print('─' * 50)
print(f"平台号 : {i.m_nPlatformID}")
print(f"经纪公司编号 : {i.m_strBrokerID}")
print(f"经纪公司 : {i.m_strBrokerName}")
print(f"资金账号 : {i.m_strAccountID}")
print(f"交易所 : {i.m_strExchangeID}")
print(f"证券代码 : {i.m_strInstrumentID}")
print(f"融券可融数量 : {i.m_nEnableAmount}")
print(f"查询类型 : {i.m_eQuerySloType}") # 48:普通,49:专项
print('─' * 50)
"""
Return
──────────────────────────────────────────────────
平台号 : 11111
经纪公司编号 :
经纪公司 : 模拟证券
资金账号 : 2000233
交易所 : SZ
证券代码 : 000001
融券可融数量 : 500000
查询类型 : 49
──────────────────────────────────────────────────
"""
官方来源
QMT 官方文档:获取可融券明细。网页核对日期:2026-10-11。