Keyboard Shortcuts
Likes
Search
IB Routinely Misses Stops and Hidden LMTs
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. |
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: ? |
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. |
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'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.
|
开云体育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? ? |
开云体育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:
? |
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. |
开云体育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. |
Richard, thanks for the references.
I'm glad IB admits to the "less than tick" methodology for stops which has been apparent to me for some time and which was included in sample code I had downloaded and the subject of this thread. Unfortunately, there is no trigger methodology simpler than STP: "Sell if the price goes below $X" and for IB to not actually "Sell if the price goes below $X," but to instead only 'Sell if the Bid is below $X and the Ask is above $X" is unacceptable to me. I?can't manage my trading like this. I handle via a personal client which executes market orders based on the observed prices and my instructions, and will in fact "Sell if the price is below $X" if I tell it to "Sell if the price is below $X."? |
By the way, I'll add here one other bit of "high-level thinking" by IB that doesn't work for my situation.
So I'm testing for concurrence, and different threads send orders at, essentially, the same time. One to Buy, another to Sell, I'm freely paying $10 for the test (Bid - Ask) (I can't truly test in paper accounts). Both orders were "MKT" orders- they were to execute, no questions asked. Well, IB rejected the second order, saying it "crossed" the first one. I suppose I can understand the motivation for this, protecting regular traders from obvious mistakes. |
what's the big deal? you can keep your? stop on your side and create whatever rules\logic you like for a trigger. personally-i would never trust their logic(i trade stocks) because with their trigger (i believe it was 2 trades at last at your price) it would miss stops most of the time when spike occur(and on stocks they occur quite often)
|
Sad, but still true.
I've seen this behaviour in paper trading, where you can actually specify the trigger method in TWS settings, and during live trading, where the stop order is getting handled by the exchange. When the market gaps over the stop trigger point, the stop order will not get executed. The stop order will just stay there for hours, while the price is well beyond. Absolutely no way trusting this system. |