softwarespartan / IB4m

Interactive Brokers API for Matlab
GNU General Public License v2.0
62 stars 21 forks source link

Possible to expose the events for "market rules"? #37

Closed Benvaulter closed 6 years ago

Benvaulter commented 6 years ago

Hi there,

any chance to expose the "market rule" events? I am trying to retrieve the minimum price variation for a given contract. The process to do this is to first request contract details and extract the "market rule id" and then insert this market rule id into another function called "reqMktRule" (https://interactivebrokers.github.io/tws-api/minimum_increment.html). Since no event is set up for this method, I am not able to fetch the data at this time. Would be great - many thanks in advance!

softwarespartan commented 6 years ago

MarketRules have been added with sample in the example folder

Benvaulter commented 6 years ago

Thank you so much Abel - much appreciated. One addition to the process. Sometimes, the method will throw an error that the market rule is unavailable - even though it should be. I had an IB Api support guy look into the issue and he found out that for some market rule ids, you have to call the contract details function beforehand - for whatever reason. So best way to ensure you can retieve results is by first calling contract details - get the respective marketRuleId from there and then call reqMarketRule after that.

All the Best!

softwarespartan commented 6 years ago

No problem.

Let me know if you need anything additional.

Re: contract details, that’s fairly common workflow for IB API. For example, options and futures require contract details to make appropriate market data call etc.

Cheers

Sent from my iPhone

On Oct 1, 2018, at 10:25 AM, Benvaulter notifications@github.com wrote:

Thank you so much Abel - much appreciated. One addition to the process. Sometimes, the method will throw an error that the market rule is unavailable - even though it should be. I had an IB Api support guy look into the issue and he found out that for some market rule ids, you have to call the contract details function beforehand - for whatever reason. So best way to ensure you can retieve results is by first calling contract details - get the respective marketRuleId from there and then call reqMarketRule after that.

All the Best!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.