VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 419
声望: 170

1、TdApi.reqQryInstrument()命令的返回

在回调函数TdApi.onQryInstrument()得到的返回结果是这样的:
以rb2010为例:

{
    'InstrumentID': 'rb2010', 
    'ExchangeID': 'SHFE', 
    'InstrumentName': '螺纹钢2010', 
    'ExchangeInstID': 'rb2010', 
    'ProductID': 'rb', 
    'ProductClass': '1', 
    'DeliveryYear': 2020, 
    'DeliveryMonth': 10, 
    'MaxMarketOrderVolume': 30, 
    'MinMarketOrderVolume': 1, 
    'MaxLimitOrderVolume': 500, 
    'MinLimitOrderVolume': 1, 
    'VolumeMultiple': 10, 
    'PriceTick': 1.0, 
    'CreateDate': '20190912', 
    'OpenDate': '20191016', 
    'ExpireDate': '20201015', 
    'StartDelivDate': '20201016', 
    'EndDelivDate': '20201022', 
    'InstLifePhase': '1', 
    'IsTrading': 1, 
    'PositionType': '2', 
    'PositionDateType': '1', 
    'LongMarginRatio': 0.1, 
    'ShortMarginRatio': 0.1, 
    'MaxMarginSideAlgorithm': '1', 
    'UnderlyingInstrID': '', 
    'StrikePrice': 0.0, 
    'OptionsType': '\x00', 
    'UnderlyingMultiple': 0.0, 
    'CombinationType': '0'
}

2、TdApi.reqQryInstrumentMarginRate()命令的返回

在回调函数TdApi.onQryInstrumentMarginRate()中得到返回结果这样是的:
以rb2010为例:

{
    'InstrumentID' : rb2010,
    'InvestorRange' : 1,
    'BrokerID' : 9999,
    'InvestorID' : 147102,
    'HedgeFlag' : 1,
    'LongMarginRatioByMoney' : 0.1,
    'LongMarginRatioByVolume' : 0.0,
    'ShortMarginRatioByMoney' : 0.1,
    'ShortMarginRatioByVolume' : 0.0,
    'IsRelative' : 0,
    'ExchangeID' : ,
    'InvestUnitID' : 
}

3、两个返回值都有关于保证金的字段

TdApi.reqQryInstrument()命令的返回中包括:

  • LongMarginRatio :多头保证金率
  • ShortMarginRatio:空头保证金率

TdApi.reqQryInstrumentMarginRate()命令的返回包括:

  • LongMarginRatioByMoney :多头保证金率
  • LongMarginRatioByVolume :多头保证金费
  • ShortMarginRatioByMoney :空头保证金率
  • ShortMarginRatioByVolume:空头保证金费
  • IsRelative:是否相对交易所收取

4、问题

1 这两个命令的返回值都包含中合约的保证金率,哪个是期货公司的实收的保证金率 ?
2 两条都是TdApi的命令,都是连接开户的期货公司的交易服务器的,还有必要执行TdApi.reqQryInstrumentMarginRate()专门获取吗 ?

Administrator
avatar
加入于:
帖子: 4500
声望: 320

应该是用后面那个,前面函数查询的是合约本身的信息(所以可以理解为交易所给的信息)

Member
avatar
加入于:
帖子: 419
声望: 170

谢谢了,我问中信建投了,他们也说是后面的这个。

© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】