download Dow Ind Avg from IBrokers API


2 0
I've been using a java open source project (IBDownloader) to succesfully download historical prices for Forex from InteractiveBrokers.

I modified the program to download the Dow Jones Industrial Avg (INDU @ NYSE), however the calls to the API appear to hang (ie. no response after 2min). Normally the IB API errors if I incorrectly call it, but it's not even doing that.
Can someone please check what I'm doing below and let me know if I'm doing something wrong?

// create a contract
mExchange = "NYSE"
mBaseCurrency = "USD"
mSymbol = "INDU"

mContract =  new Contract(0, mSymbol, "IND", "",
                0, "", "",
                mExchange, mBaseCurrency, "", "",
                new Vector<ComboLeg>(), mExchange, false,
                "", "");

mRequestField = "MIDPOINT"

// make the call to fetch the data
mClient.reqHistoricalData( 0, mContract,
                requestDateTimeStr, "1 D", //request in 1 day blocks
                "1 min", mRequestField,
                1, 1, null);

The client log for the IB Gateway then looks like this...

15:24:06:076 <- 20-6-0-0-INDU-IND--0.0---NYSE-NYSE-USD---0-20151106 12:00:00-1 min-1 D-1-MIDPOINT-1--
15:24:06:069 -> 4-2--1-2119-Market data farm is
15:24:07:336 -> 4-2--1-2104-Market data farm connection is
AdBlock Detected

We get it, advertisements are annoying!

But it's thanks to our sponsors that access to Trade2Win remains free for all. By viewing our ads you help us pay our bills, so please support the site and disable your AdBlocker.

I've Disabled AdBlock