开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Limitations on data requests. Requesting 120 options in option chain.


 

Dear all,

I'm reading an option chain op 120 options with the function reqMktData. So I guess that counts as 120 market data requests. I also read: "can only have 100 simultaneous mkt data request active" But I'm confused about this limitation.

So I have the questions about, when is the request active.

1) Does this limitation of 100 only hold for reqMktData? So all other requests are not counted.
2) Does a snapshot also count for 1 request? Or only streaming requests.
3) Should every reqMktData (snapshot or not) be followed by a cancelMktData at some point in time to become inactive? Or are reqMktData also canceled automatically (e.g. maybe in case of a snapshot.) Or ....


 

1.) Other request are also counted. Even if you have the TWS open simultaneously the quotes shown in the TWS also count. Every market data line.
2.) Only streaming requests.
3.) This depends on what you are doing. Since you only have 100 MarketData lines (without booster package) you maybe have to cancel some lines you don't need any longer so you can request new ones.
Otherwise are all lines automatically canceled when you disconnect from the TWS.


 

Thank you very much!!

1) So calls like reqAccountSummary (all req...) does count also. But the reqMktData snapshot does not count?
2) Is it true that: all req... that have a cancel... counter part are streaming and count. The others like reqPositions do not count, they could never be streaming?

That makes it quite complicated. Because if you need the option greeks, open interrest and IV. All the option data for 1 contract is coming asynchronous and in multiple messages. And it's not possible to do a snapshot on these. So it's hard to know when you have all the data of one option to close the stream. If you have tips on how to handle this I would love to hear.


 

1) reqAccountSummary shouldn't take a market data line, probably it's not count. For a snapshot I can't say how it works, havent tried that (it may cost money if requiring snapshot many times)
2) Please note that other methods may have other limitations, for example market depth only 3 instruments simultaneously, not 100

3) yes it quite complicated. You can either up your limit to 200 lines, or make some subscription rotation. Like TWS do, when you don't see instrument on the screen, it unsubscribes from it.


 

Thanks for the tip! Good to know.

What is not clear for now is the definition of a market data line (because those have the 100 count limit).

1) If I only look at the API (not what's happening in TWS), how can I see what is also a market data line?

- it is not only reqMktData
- it's not the req... that also have a cancel...
- I cannot find it in the manual.
- I cannot receive the number of lines already used, from the API.

2) If there is no value (e.g. like there is no volume of the option at that moment) That message will not come, not even as 0? So I can't wait for all the data because I don't know if there is data (coming) or not.


 

Did you find this page, which explains the limitations at the bottom of the page:? https://interactivebrokers.github.io/tws-api/market_data.html
Read the section titled "Market Data Lines"


 

There is a hotkeys Ctrl Alt =
to see market data lines, as noted here


It works both in TWS and in IB Gateway.


 

Super, thanks a lot!! I didn't know that.

One question left. Can someone tell how reliable the Ctrl Alt = counter is?

If I fetch an option chain only in TWS and chose SMART as exchange. It counts the lines correctly. But if I switch to another exchange like CBOE the count (roughly) doubles. So to my experience only SMART gives the right values. The other exchanges twice too much.


 

Hi Nick64,

I am trying to get my API working to get some option data using reqMktData. Very interested in the fact that you have got yours to work. I'm using JAVA but even if you are using another language I will be grateful if you could show me an example of what are the parameters you are using for reqMktData to work. Thanks in advance for your timw.


 

Sorry for the late reply.

My starting point was the sample app of the API. Very usefull. My call I now use for example:

reqMktData(mktDataRequest, FullContract, "", true, false, new List<TagValue>());

Where
mktDataRequest is an int number
FullContract is the contract I get in API message

ibClient.ContractDetails += HandleContractDataMessage;
void HandleContractDataMessage(ContractDetailsMessage message) {};

after asking for the contract details.

I hope this helps, success.