Request IB Tick Data - JAVA API

Quote from promagma:

haha it was a wild guess - the IB API is a funny thing :)
The rest is easy.

Code:
    		if (field == TickType.BID)
    			System.out.println("Holy cow this is working, I got bid " + (float)price);
    		else if (field == TickType.ASK)
    			System.out.println("Holy cow this is working, I got ask " + (float)price);
    		else if (field == TickType.LAST)
    			System.out.println("Holy cow this is working, I got last " + (float)price);


Mmmm.... Not sure what you mean.

So , the code you recommended above should be added to the tickPrice method in the PrintWrapper class which implements in EWrapper.

I want to store the price and size of a specific bid and ask tick in my main file where a print wrapper objext exists. I'm thinking unless I can overload the tickPrice method, but I'm not sure if that still helps because in the main file, I have

Code:
    client.reqMktData(tickerId, con, "100,101,104,106,162,165,221,225", true);

What I have is a Strategy object in the main file (i.e. PrintTestForex class )to which I was planning on passing EClientSocket as a parameter. I'm wondering if that's how you do it? Or how would you recommend I do it.

More specifically I want the ESocketClient object not just to print market data but return it so that I can store it in a variable. The TickPrice method in wrapper class doesn't return anything.
 
Back
Top