开云体育

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

IB Routinely Misses Stops and Hidden LMTs


 

@jcopp
You can only set the trigger method for simulated orders, in live trading it is up to the exchange and i suppose they are using the default method.

int? [get, set]
? Specifies how Simulated Stop, Stop-Limit and Trailing Stop orders are triggered.
Valid values are:
0 - The default value. The "double bid/ask" function will be used for orders for OTC stocks and US options. All other orders will used the "last" function.


@闯ü谤驳别苍 Reinold
Thanks for the info. I'll add the condition to all orders in the bracket and test it.
I am still wondering though, why the stops worked with most other orders.


 

Correct. You set OutsideRth to true on every order object in the bracket. But at least on STOP orders. Order presets defined within TWS have no impact on your TWS API client.

As a matter of practice, we set OutsideRth true on all orders in the bracket for ES trades, but apparently only the StopLoss STOP order really needs it set for triggers to work. In fact we get Error 2109 warnings on all other orders: 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.

In the example below OutsideRth was set to true for all four orders in the bracket

  • 222 MKT entry order
  • 222.1 LMT profit taker order
  • 222.2 STOP stop loss order
  • 222.3 MKT position close order with time condition at 15:55 Central time
Placing orders 222, 222.1, and 222.3 triggers (error) warning 2109, but placing 222.2 does not and it will not trigger outside of the regular trading hours without OutsideRth? set to true.

闯ü谤驳别苍





On Thu, Jun 23, 2022 at 04:42 PM, Jenzi wrote:
That's a very interesting thought, because the exits were made in the second the us markets did open.
Otherwise, i have made many other trades during the day where it worked (same instrument, exits on taget limit or stop).
In the TWS 'Global Configuration' - 'Presets' for Futures the checkmark is set.

You mean to set the option for every bracket order when creating/sending an order? I'll give that a try.

bool? [get, set]
? If set to true, allows orders to also trigger or fill outside of regular trading hours.


 

One factor to consider is which trigger to use: Bid, Ask, or Last. That obviously plays a role, including vulnerability when bored institutional traders run the Stops.

On Thu, Jun 23, 2022 at 2:42 PM Jenzi <jzip@...> wrote:
That's a very interesting thought, because the exits were made in the second the us markets did open.
Otherwise, i have made many other trades during the day where it worked (same instrument, exits on taget limit or stop).
In the TWS 'Global Configuration' - 'Presets' for Futures the checkmark is set.

You mean to set the option for every bracket order when creating/sending an order? I'll give that a try.

bool? [get, set]
? If set to true, allows orders to also trigger or fill outside of regular trading hours.


 

That's a very interesting thought, because the exits were made in the second the us markets did open.
Otherwise, i have made many other trades during the day where it worked (same instrument, exits on taget limit or stop).
In the TWS 'Global Configuration' - 'Presets' for Futures the checkmark is set.

You mean to set the option for every bracket order when creating/sending an order? I'll give that a try.

bool? [get, set]
? If set to true, allows orders to also trigger or fill outside of regular trading hours.


 

开云体育

Did you set the stop-loss orders to execute outside regular trading hours? It’s not enough just to set that for the parent order.

?

?

?

From: twsapi@groups.io <twsapi@groups.io> On Behalf Of Jenzi
Sent: 23 June 2022 20:16
To: twsapi@groups.io
Subject: Re: [TWS API] IB Routinely Misses Stops and Hidden LMTs

?

It's ES before the US open, during European markets.


 

It's ES before the US open, during European markets.


 

Ok, pulled up a footprint of the situation, basically this should not be possible to happen.


 

How liquid are the contracts you're trading? Even if the stop gets triggered you still need some liquidity for the trade to execute


On Thu, Jun 23, 2022 at 11:52 AM Jenzi <jzip@...> wrote:
These aren't Stop Limits 'STP LMT', but Stop Orders 'STP', that should exit via a market order, when according to IB doc "the user-specified stop trigger price is attained or penetrated".
This is happened live. And i've seen this with Trailing Stops too.
I've checked the ES trades, take a look at the 2min chart, i've marked the two candles with the short entries, it wasn't even a volatile market and i doubt anything got jumped. The exits were made more than four hours later.


 

These aren't Stop Limits 'STP LMT', but Stop Orders 'STP', that should exit via a market order, when according to IB doc "the user-specified stop trigger price is attained or penetrated".
This is happened live. And i've seen this with Trailing Stops too.
I've checked the ES trades, take a look at the 2min chart, i've marked the two candles with the short entries, it wasn't even a volatile market and i doubt anything got jumped. The exits were made more than four hours later.


 

Apologies if I'm being slow, the image shows two ES brackets, both of which have triggered stops. Assuming your last column is the average fill they did get caught clearing above their trigger level - that's expected isn't it? I think your stop is a market order triggered at a certain price. If your example shows the stop not triggering, can you please clarify it for me, I'm reading it as "every stop here was triggered and cleared"
Note the difference between
order.OrderType = "STP";? // Market order placed on price trigger
and
order.OrderType = "STP LMT"; // Limit order placed on price trigger

Best wishes,


M


On Thu, 23 Jun 2022 at 19:02, Rob Tilley Jr. <fladventurerob@...> wrote:
Does this behavior occur in live trading, or just paper trading? Per IB own docs (and every other broker I've ever used) a stop-limit "is an instruction to buy or sell limit order when the stop trigger price is attained or penetrated." The thought that this wouldn't trigger and become marooned if it jumps below is confusing to me, because there shouldn't be any condition in which that would occur if I'm understanding this issue correctly?

On Thu, Jun 23, 2022, 1:57 PM jcopp <johndcopp@...> wrote:
If you're using LIMIT stops, that's how they behave. If the market suddenly leaps over or below your stop, it's marooned. Try using a TRAIL and monitor it closely.

On Thu, Jun 23, 2022 at 10:09 AM Jenzi <jzip@...> wrote:
Just from yesterday and today.



--
+44 (0) 7528 551604?
Gulfstream Software - Winner Risk Management Awards 2010
This message is subject to :


 

Does this behavior occur in live trading, or just paper trading? Per IB own docs (and every other broker I've ever used) a stop-limit "is an instruction to buy or sell limit order when the stop trigger price is attained or penetrated." The thought that this wouldn't trigger and become marooned if it jumps below is confusing to me, because there shouldn't be any condition in which that would occur if I'm understanding this issue correctly?


On Thu, Jun 23, 2022, 1:57 PM jcopp <johndcopp@...> wrote:
If you're using LIMIT stops, that's how they behave. If the market suddenly leaps over or below your stop, it's marooned. Try using a TRAIL and monitor it closely.

On Thu, Jun 23, 2022 at 10:09 AM Jenzi <jzip@...> wrote:
Just from yesterday and today.


 

If you're using LIMIT stops, that's how they behave. If the market suddenly leaps over or below your stop, it's marooned. Try using a TRAIL and monitor it closely.

On Thu, Jun 23, 2022 at 10:09 AM Jenzi <jzip@...> wrote:
Just from yesterday and today.


 

Just from yesterday and today.


 

Do you have an example? I've used IB for years and not seen the behaviour you describe ( though I've encountered plenty of other weirdnesses)

Best wishes,


M

On Wed, 22 Jun 2022, 19:09 Jenzi, <jzip@...> wrote:
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.


 

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.


 

Hi Dude,

The "Big Deal" was to leave clear messages/ask somewhat rhetorical questions for those of us building trading clients, reminding of the hard decisions we need to make. Indeed, I've done as you suggest.?


 

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)


 

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.


 

I'll add this may be a uniquely critical problem in futures, where the bid-ask spread can be the size of the tick. In equities, this is much less often the case, so the IB method may not fail often in equities, even on earnings releases, etc. I don't trade equities at HF so I don't know.


 

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."?