What CPP code are you referring to?
The API does not manage the execution of the stops. The API sends
the order to TWS/Gateway and after that the API is not involved in
the execution.
On 9/21/2014 10:12 AM,
fantasyfootball672@... [TWSAPI] wrote:
toggle quoted message
Show quoted text
?
I built my own application where I manage all of my
open orders on my application because IB routinely
missed stops in my markets (futures.) It wasn't an
occasional deal- if there was market-moving info, the
stop would be blown thru. Mind you, these are the stops
IB maintains- if you place a LMT order on the floor the
order won't be blown thru, of course. But IB will also
fail to execute a hidden LMT.
I was disgusted by this, but then when I went thru
every line of the CPP API I found the culprit. IBs logic
is to execute a stop if the current relevant price is
less than one tick away from the target-Limit. Yes, you
read that right- IB does not use inequality logic
(properly, they would Buy if the Price is Below your
LMT), rather an Equality logic (they Buy if the Price is
Equal to your LMT). This is amazing hackdom by IB,
probably costing their algo and HFT traders millions of
dollars each year.
They are worthless for stops/limits, and you need to
have a plan for thiis if you engage in HFT.