reqMktDataType: Request Market Data Type from TWS

View source: R/reqMktDataType.R

reqMktDataTypeR Documentation

Request Market Data Type from TWS

Description

Set the market data type with TWS

Usage

reqMktDataType(conn, mktDataType = 3)

Arguments

conn

a valid twsConnection or twsPlayback connection

mktDataType

market data type code

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.

Value

NULL (invisibly)

Author(s)

Joshua M. Ulrich

References

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

See Also

twsConnect, reqMktData

Examples

## Not run: 
tws <- twsConnect()
contract <- twsEquity("QQQQ","SMART","ISLAND")
# set market data type to 'delayed'
reqMktDataType(tws, 3)
reqMktData(tws, contract)

## End(Not run)

IBrokers documentation built on Nov. 16, 2022, 5:05 p.m.