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()专门获取吗 ?