Issues reading minTick from Interactive Brokers Java API
我使用Interactive Brokers API时遇到一些问题:当我使用
请求合同详细信息时
1 | m_controller.reqContractDetails(contract, t); |
我收到了数据;其中包含字段minTick,该字段似乎始终显示1.0E-4
当我使用PlaceOrder方法传输订单时,将价格设置为0.0001的倍数时会遇到以下错误消息:
1 | 110 The price does not conform to the minimum price variation for this contract. |
我不确定导致此问题的原因是我是否错误地使用了此值。
任何帮助将不胜感激。
谢谢。
我与IB的技术支持取得了联系,这就是他们对于合同的minTick属性必须说的话:
user: Hello, I'm trying to obtain the minimum price for a given stock but I am having some issues: when I obtain the data from reqContractDetails, I get consistently a minTick of 1.0E-4, but when I place an order with an increment of 0.0001, I get the error: The price does not conform to the minimum price variation for this contract.
user: I have verified this with stocks such as VLTC and PBMD
user: it only allows me to place an order with a price increment of 0.01, which is not consistent with minTick
IB Agent: The minimum price from contractDetails() is not a complete information.
IB Agent: Unfortunately, it won't provide more information
IB Agent: you need to examine the
IB Agent: http://www1.interactivebrokers.ch/contract_info/index2.php
user: so there is no programmatic way to obtain the minimum tick price for a given stock
IB Agent: In using our API, no
IB Agent: is this US stocks?
user: yes
IB Agent: normally it is above $1, then the price increment is .01
换句话说,用于IB API的minTick并不是一种了解给定股票的最小变动量的可靠方法,必须考虑采用其他方法来执行此任务。
从TWS API的v973.03开始,提供了一个新功能reqMarketRule,该功能在每个价格水平上提供最小的增量。这对于最小增量可以随工具市场价格变化的欧洲股票很有用。
API文档。
IB经纪人是正确的。通常,在美国(股票),它将为0.01。
如果您使用外汇,则为0.0001。
如果您在欧洲进行贸易,可能会有一些差异,例如以法国为例:
http://www.boursorama.com/cours.phtml?symbole=3kMAOMF
如果您想确定最小价格变动,我可以获取价格并计算小数位数,或者去Yahoo Finance进行操作...