Skip to content
Prev 13824 / 15274 Next

IBrokers - functions: eWrapper and CALLBACKS

Hi Robert

Thanks for the reply.  I was assuming that the package was OK as my 
experience with programming nearly always turns out to demonstrate its 
my fault ;-(

My problem is I don't really understand how eWrapper and CALLBACKS work 
together.  I find if I can work on existing code like that I found for 
trading based on on it I can get somewhere. I found something and ended 
up with this call:

reqMktData(con, list(twsEquity(symbol=sym1, exch='ASX', 
currency='AUD'),twsEquity(symbol=sym2, exch='ASX', currency='AUD')),  
eventWrapper=eWrapper.data(2), CALLBACK=CO_INT_N_REV)

and managed to put everything I wanted inside the callback.  I'd love to 
find something similar on reqMktDepth as at the moment I can only manage 
these sorts of calls:

reqMktDepth(tws, contract, 
file="C:\\Users\\Stephen\\Documents\\R\\current working market 
depth\\ticks.txt")
reqMktDepth(tws, contract, 
eventWrapper=eWrapper.MktDepth.CSV(),file="C:\\Users\\Stephen\\Documents\\R\\current 
working market depth\\ticks1.txt")


and I would love to be able to write a callback.

In addition I am desperate to find something on 'has the order been 
closed?' just like you.

Maybe someone can point us to some code that we can work with.

Stephen


----------------------------------------------------------------------------------------------------------------------------------- 

Stephen Choularton PhD, FIoD
On 4/04/2016 11:47 PM, Robert Schien wrote: