Richard,
I ran into another problem: the connection doesn't get dropped.
Server Response: error, <error id=-1, errorCode=326, errorMsg=Unable connect as the client id is already in use. Retry with a unique client id.>
I check on Help -> Data Connections on TWS and found the connection being kept alive despite I always called?conn.disconnect() after placing orders. ?Any idea on resolving this?
Best,
?