Learn R Programming

IBrokers (version 0.10-2)

reqMktDataType: Request Market Data Type from TWS

Description

Set the market data type with TWS

Usage

reqMktDataType(conn, mktDataType = 3)

Value

NULL (invisibly)

Arguments

conn

a valid twsConnection or twsPlayback connection

mktDataType

market data type code

Author

Joshua M. Ulrich

Details

This function sets the market data type that will be returned by TWS when reqMktData is called.

1

Real-time: Live data is streamed back in real time. Market data subscriptions are required to receive live market data.

2

Frozen: Market data is the last data recorded at market close. Frozen data requires TWS/IBG v.962 or higher and the same market data subscriptions necessary for real time streaming data.

3

Delayed: Market data 15-20 minutes behind real-time (depending on the exchange). Automatically use delayed data if user does not have a real-time subscription. Ignored if real-time data is available.

4

Delayed-frozen: Requests delayed "frozen" data for users without market data subscriptions.

References

Interactive Brokers API: https://interactivebrokers.github.io/tws-api/index.html

See Also

twsConnect, reqMktData

Examples

Run this code
if (FALSE) {
tws <- twsConnect()
contract <- twsEquity("QQQQ","SMART","ISLAND")
# set market data type to 'delayed'
reqMktDataType(tws, 3)
reqMktData(tws, contract)
}

Run the code above in your browser using DataLab