Subscribing for Single Stock Futures wit TWS API

dr_trick

Junior member
Messages
32
Likes
0
Hi all,

i need some help please. i've been pulling my hair out on this. i'm using the java API to connect to TWS to pull some market data into my application. i can receive data on stocks, but for some reason the i keep getting a "no security definition" error every time i try requesting data on single stock futures.

if i enter the symbol (e.g. MSFT1DM2) in TWS, the price comes up straight away. but with the API i when i try :

contract.symbol = MSFT1DM2 (or just MSFT)
contract.sec_type = FUT
contract.expiry = 201206 (or JUN12)
contract.exchange = ONE
contract.pry_exchange = ONE
contract.currency = USD

i get the error. i've tried all sorts of combinations. i even tried requesting the contract details before subscribing (but that comes up empty too).

i'm surprised that i can see the futures price on the front end but i can't subscribe to it via the api.

any help is really appreciated !!!!


cheers
 
Hi all,

i need some help please. i've been pulling my hair out on this. i'm using the java API to connect to TWS to pull some market data into my application. i can receive data on stocks, but for some reason the i keep getting a "no security definition" error every time i try requesting data on single stock futures.

if i enter the symbol (e.g. MSFT1DM2) in TWS, the price comes up straight away. but with the API i when i try :

contract.symbol = MSFT1DM2 (or just MSFT)
contract.sec_type = FUT
contract.expiry = 201206 (or JUN12)
contract.exchange = ONE
contract.pry_exchange = ONE
contract.currency = USD

i get the error. i've tried all sorts of combinations. i even tried requesting the contract details before subscribing (but that comes up empty too).

i'm surprised that i can see the futures price on the front end but i can't subscribe to it via the api.

any help is really appreciated !!!!


cheers



hacked my way around. the minute i submitted the question i had a brain wave and it's solved. i.e.

contract.symbol = msft
contract.localsymbol = msft1dm2

ta
 
Top