开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

IB Routinely Misses Stops and Hidden LMTs


 

开云体育

Can you please clarify exactly what order type you are using for your stop loss order (using IB’s terminology, please!).

?

If you’re using a STP LMT order, then as Pankaj Sharma pointed, out the situation you describe is quite likely even if the trigger fires.

?

In any case you need to read and understand the description in the TWS User guide of the various stop trigger methods that IB provides (see ).

?

For the ‘Last’ trigger method, which is the default for futures, it says:

“For a buy (sell) order to be triggered:

o??? One last price value must be greater than (less than) or equal to the trigger price; and

o??? The exchange or other market center where the order is to be executed must also publish (and the system must also receive) an ask price equal to or higher than, and a bid price equal to or lower than, the trigger price; and

o??? Last must be within the bid/ask (i.e. >=bid and <= ask) or within leeway percentage outside the bid/ask (i.e. >=bid-0.5% of last and <=ask+0.5% of last). This 0.5% amount of leeway is subject to change at any time without notice.

With the exception of OTCBB- and Pink Sheets-listed stocks, stop and stop-limit order in US stocks will also only be triggered if the primary exchange on which the stock trades is open, is holding regular trading hours, and has a valid bid/ask quote for the stock. Regular trading hours are usually between 9:20 am - 4:00 pm Eastern Time, Monday through Friday for exchange-listed stocks. NOTE: This limitation does not apply to stop or stop-limit orders in futures contracts).”

?

I have to admit that it’s a long time since I’ve read this stuff, and it’s not the same as it used to be: the second and third conditions didn’t used to be there, and I can imagine that they might cause the kind of problems you’re describing. It’s not clear to me what the rationale behind these conditions is.

?

Maybe one of the other trigger methods would give you better results?

?

?

?

From: TWSAPI@... [mailto:TWSAPI@...]
Sent: 22 September 2014 10:29
To: TWSAPI@...
Subject: Re: [TWS API] Re: IB Routinely Misses Stops and Hidden LMTs

?

?

No, I was using my own jargon, which I will not do.

?

IB misses "STP"s, all of the time in volatile futures. These orders are held for execution on their system, and missed. If you trade a lot of futures, you've seen this happen, a lot. It is not rare. As an example, when the government releases energy statistics, IB will miss any stop if the price moves thru it on the news. IB's system uses a "trigger" to execute the stop- it does not "poll."?

?

If I have a stop-loss at $94.00 in a crude oil position, and if the price of Crude Oil is $94.05 before the statistics release, and $93.50 right thereafter, the stop will not execute. And if you look 10 minutes, or 10 hours later, the stop will still not have executed.

?

If you call IB and ask them about stops during periods of rapid price changes, they will confirm all of this to you. But, again, it's easy to see if you trade futures, because it will happen to you on market-moving news.


 

No, I was using my own jargon, which I will not do.

IB misses "STP"s, all of the time in volatile futures. These orders are held for execution on their system, and missed. If you trade a lot of futures, you've seen this happen, a lot. It is not rare. As an example, when the government releases energy statistics, IB will miss any stop if the price moves thru it on the news. IB's system uses a "trigger" to execute the stop- it does not "poll."?

If I have a stop-loss at $94.00 in a crude oil position, and if the price of Crude Oil is $94.05 before the statistics release, and $93.50 right thereafter, the stop will not execute. And if you look 10 minutes, or 10 hours later, the stop will still not have executed.

If you call IB and ask them about stops during periods of rapid price changes, they will confirm all of this to you. But, again, it's easy to see if you trade futures, because it will happen to you on market-moving news.


 

开云体育

I don't believe IB has an order type of "basis stop".

It is possible that your code sends a STP LMT order and that is why you have unfilled stops on gaps.


On 22/09/2014 14:40, fantasyfootball672@... [TWSAPI] wrote:

?

Peter, he's asking me, rhetorically, to be very precise in my wording, which is more than fair.



 

Peter, he's asking me, rhetorically, to be very precise in my wording, which is more than fair.


 

开云体育

Info. Here on STP LMT orders.

?

P.

?

From: TWSAPI@... [mailto:TWSAPI@...]
Sent: 22 September 2014 05:40
To: TWSAPI@...
Subject: [TWS API] Re: IB Routinely Misses Stops and Hidden LMTs

Would you care to show (preferably by referring to the page on the link below) where IB offers a LMT-STP order?

?


 

referred to as a "STP" on that page. i use LMT to refer to the fact the order must be entered as a LMT order to be bracketed- IB does not support a bracket on a market order.


 

It's a basis stop-loss order, where the second order, to cover, is executed as a market order rather than as a limit order.


 

Would you care to show (preferably by referring to the page on the link below) where IB offers a LMT-STP order?

?




 

I retract that [art of the statement, for now, because the sample code I downloaded wasn't from the IB website itself and now I'm not sure of the provenance. Apologies. The code was for a LMT order to execute within a Do loop on fabs(Price - LMT) < tick.


 

I'm still waiting for you to answer to Ed's question "What CPP code are you referring to?"?

You said you saw this behavior in the IB code: "I went thru every line of the CPP API I found the culprit."

Please produce the code, or revise your statement.

?
--
Stergios Marinopoulos



From: "fantasyfootball672@... [TWSAPI]"
To: TWSAPI@...
Sent: Sunday, September 21, 2014 8:12 AM
Subject: Re: [TWS API] IB Routinely Misses Stops and Hidden LMTs

?
I don't write very well- please accept my apology for this.

Here is an example:

Suppose the current bid for CME Crude Oil is $94.00. Suppose you are long One contract, entered as a LMT-STP order, (say purchased at $94.05) with a Stop-Loss of $93.95, entered as a STP (to be executed as a MKT order by the system).

Suppose the price of Crude Oil "air gaps" to $93.90.

Your stop will never execute. It didn't execute thru the gap (which is understandable), but it won't execute now, even though the market price is 5 cents below your stop-loss. On TWS, you still see your order's stop-loss at $93.95, still "ready" to execute.


IB admits this flaw, and now disclaims liability over this. It's absurd.



 

I don't write very well- please accept my apology for this.

Here is an example:

Suppose the current bid for CME Crude Oil is $94.00. Suppose you are long One contract, entered as a LMT-STP order, (say purchased at $94.05) with a Stop-Loss of $93.95, entered as a STP (to be executed as a MKT order by the system).

Suppose the price of Crude Oil "air gaps" to $93.90.

Your stop will never execute. It didn't execute thru the gap (which is understandable), but it won't execute now, even though the market price is 5 cents below your stop-loss. On TWS, you still see your order's stop-loss at $93.95, still "ready" to execute.


IB admits this flaw, and now disclaims liability over this. It's absurd.


 

Ed, I'm well aware of all of this.?

I have wondered why IB misses stops and the logic they use in the API tells me the loigic they use on their system. They are the same.?

If IB misses a stop on an order on their server, they never realize it and execute- the trigger event is the near-equality. You can look up and your stop-loss is still held on the system with the price 5 cents below where you asked them to stop.

They will even confess this on the phone.

But I didn't really understand the exact issue until working thru the API and seeing how their brain works. Or doesn't work.


Ed
 

开云体育

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:

?

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.



 

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.