Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 18:25:33 +0000



Post From: A Better Implementation of Interactive Broker's Data Feed

[2013-04-11 22:08:38]
Bad Dog - Posts: 17
Here is what I used to code the data feed:

reqMktData() - Call this function to request market data. The market data will be returned by the tickPrice() and tickString() events.

void reqMktData(TickerID id, const Contract &contract, CString genericTicklist, bool snapshot)
The String, generericTickList is passed as string "233"

1.Use event tickPrice() to retrieve the latest askprice (ticktype=1) and bidprice (ticktype=2).
2.Use event tickString() to retrieve rtVolume events (tickType=48). IB's documentation mistakenly says that RTvolume is passed by tickGeneric() but this is wrong. RTVolume is a string and is passed by the tickString() event.

Fields in struct s_IntradayRecord:

double DateTime.............RTVolume(lastprice, volume, dateTimeStamp, TotalVolume, VWAP, Single trade flag)
float Open .................RTVolume(lastprice, volume, dateTimeStamp, TotalVolume, VWAP, Single trade flag)
float High .................RTVolume(lastprice, volume, dateTimeStamp, TotalVolume, VWAP, Single trade flag)
float Low...................RTVolume(lastprice, volume, dateTimeStamp, TotalVolume, VWAP, Single trade flag)
float Close.................RTVolume(lastprice, volume, dateTimeStamp, TotalVolume, VWAP, Single trade flag)
unsigned long NumTrades.....1
unsigned long TotalVolume...RTVolume(lastprice, volume, dateTimeStamp, TotalVolume, VWAP, Single trade flag)
unsigned long BidVolume.....tickPrice() passing ticktype=2. If lastprice<=bidprice then BidVolume=volume else 0
unsigned long AskVolume.....tickPrice() passing ticktype=1. If lastprice>=askprice then AskVolume=volume else 0

BD
Date Time Of Last Edit: 2013-04-11 22:13:13