I followed the guide on IBs website (http://www.interactivebrokers.com/en/general/education/pdfnotes/PDF-TwsExcelAPI.php) on how to connect IB TWS to excel, and have done so successfully. However I am wondering how you add Options Chain data into Excel?
via DDE you place each option symbol into a control formula: =edemo|tik!id1?req?SPY_OPT_20120316_122_C_SMART_USD Than add cells for the fields you want: =edemo|tik!id1?ASK =edemo|tik!id2?BID Their symbology is a PITA: ES_FUT_201203_GLOBEX_USD SPY_STK_SMART_USD SPY_OPT_20120316_122_C_SMART_USD SPY_OPT_20120316_123_C_SMART_USD SPY_OPT_20120316_124_C_SMART_USD SPY_OPT_20120316_125_C_SMART_USD SPY_OPT_20120316_126_C_SMART_USD SPY_OPT_20120316_127_C_SMART_USD SPY_OPT_20120316_128_C_SMART_USD SPY_OPT_20120316_129_C_SMART_USD SPY_OPT_20120316_130_C_SMART_USD SPY_OPT_20120316_131_C_SMART_USD SPY_OPT_20120316_132_C_SMART_USD SPY_OPT_20120316_133_C_SMART_USD SPY_OPT_20120316_134_C_SMART_USD SPY_OPT_20120316_135_C_SMART_USD SPY_OPT_20120316_136_C_SMART_USD SPY_OPT_20120316_137_C_SMART_USD SPY_OPT_20120316_138_C_SMART_USD ES_FOP_20120316_1215_C_GLOBEX_USD ES_FOP_20120316_1220_C_GLOBEX_USD ES_FOP_20120316_1225_C_GLOBEX_USD ES_FOP_20120316_1230_C_GLOBEX_USD ES_FOP_20120316_1235_C_GLOBEX_USD ES_FOP_20120316_1240_C_GLOBEX_USD ES_FOP_20120316_1245_C_GLOBEX_USD ES_FOP_20120316_1250_C_GLOBEX_USD ES_FOP_20120316_1255_C_GLOBEX_USD ES_FOP_20120316_1260_C_GLOBEX_USD ES_FOP_20120316_1265_C_GLOBEX_USD ES_FOP_20120316_1270_C_GLOBEX_USD ES_FOP_20120316_1275_C_GLOBEX_USD ES_FOP_20120316_1280_C_GLOBEX_USD
Alright gotcha, thanks for the reply. While we're at it, is there any way to make Excel automatically update an active order if I change around the order attributes? (so that I dont have to press "Modify/Update" each time)
Also, your answer is how to request data for one cell. But how can you request data for an entire column? Say I want a new column which gives me Time Value or Midpoint for all the contracts on the list. How can I do this?
I would suggest looking at their sample workbook and tear apart their formulas and VBA code. I believe they have examples for what your looking to do. Also might want to checkout OEC and their DDE guide (very similar to IB).
Again thanks for your answer. I read through the documents on DDE and VBA and managed to modify the IB API DDE template to fit my needs, at least partially. One of the biggest problems now is when I modify an order, it seems to take around 300-1000ms for IB TWS to pick up the data. I have set the "Refresh rate" and "Processing rate" in the IB template to 150 ms. Still there seems to be a large delay. Is there any way to fix this?
DDE link is just a very slow channel, not really design for high-speed data exchange. If you need high response time - you should use sockets through C++ or Java API