For a specific socket connection, set the market data type to one of
REALTIME (initial setting for all new sockets), FROZEN,
DELAYED, or DELAYED_FROZEN. In InteractiveTradeR,
this function should not be called on its own. Rather, it is used
internally by other req_ functions, such as req_mkt_data.
req_market_data_type() is included in InteractiveTradeR to cover the
hypothetical case in which the user might need it.
req_market_data_type(mktDataType, channel = NULL)
| mktDataType | Either:
|
|---|---|
| channel | One of the following:
|
The type of market data retrieved on a given sock can be set to one of the values below. Note that the difference between REALTIME, FROZEN and DELAYED_REALTIME, DELAYED_FROZEN is that the DELAYED data may be obtained for free on an IB paper account without a data subscription and with no actual funds deposited.
Streaming market data (live), fed to the socket in real time. Market Data Subscriptions are required to make use of this setting.
Also requires
Market
Data Subscriptions. If utilized, this mode will send the last quote
available for an asset in the event that there is no REALTIME
price available at the time of of a call to req_mkt_data(); for
example, if the call is made outside of trading hours.
Does not require any data subscriptions, but will return data delayed by 15 to 20 minutes.
Same behavior as FROZEN, except applies to DELAYED data as opposed to REALTIME and does not require any data subscriptions.
Market data types are described in IB's official documentation here: Market Data Types.
By setting up subscriptions on sockets set to different market types, you may have multiple market data subscriptions running simultaneously on different market types. This can be handy in use cases for which REALTIME market data is needed for a certain data stream, but DELAYED market data will suffice for a different stream for which a subscription is not available/desired.
Other market data:
cancel_mkt_data(),
req_mkt_data()