Monday, September 24, 2012

Option data captured into database

I managed to capture stock option data into database. I made two mistakes and found the tricks to get it working. The first one was to set expiration Friday instead of the technical expiration Saturday, e.g. stockOption.setExpiration(friday). The second one was to add ib.genericTickList=101,100 setting into conf-base.properties. Below is the IB documentation on Generic Tick Types:

http://www.interactivebrokers.com/php/apiUsersGuide/apiguide/api/generic_tick_types.htm

Integer ID Value
Tick Type
Resulting Tick Value (see list below)
100
Option Volume (currently for stocks)
29, 30
101
Option Open Interest (currently for stocks)
27, 28
104
Historical Volatility (currently for stocks)
23
106
Option Implied Volatility (currently for stocks)
24
162
Index Future Premium
31
165
Miscellaneous Stats
15, 16, 17, 18, 19, 20, 21
221
Mark Price (used in TWS P&L computations)
37
225
Auction values (volume, price and imbalance)
34, 35, 36
236
Shortable (see “Tick Values” for more information)
46

No comments:

Post a Comment