- ago
Hi everyone,

I'm running a test strategy with LMT and STP sell orders in the Strategy Monitor on an IB demo account, and I've noticed two strange behaviors in live trading.
Strategy Setup:

It’s a simple strategy:

- Buy at market
- Place a bracket sell order with a LMT and a trailing STP



What Happened:

The strategy bought as expected at Monday’s open and correctly placed the LMT and STP orders.
On Monday, neither order was hit.
On Tuesday’s open, the strategy canceled the existing LMT and STP orders and replaced them with new ones.

Now, two things happened:

(1) The new STP and LMT orders were not transmitted.
In the Order Manager, I see the message: "Order can have only one flag: Outside RTH or Allow PreOpen." What confuses me is that the same setup worked fine on Monday.

(2) The LMT order price changed unexpectedly.
The new STP order got a new price, which makes sense since it's a trailing stop. However, the LMT order also received a new price, which I didn’t expect, and it doesn’t match what happens in backtests.

I’ve attached screenshots of the Order Manager (no orders were deleted) and the orders in TWS.





Any ideas on why this is happening?

For reference, here’s a screenshot of my current trading preferences:



Thanks in advance!
0
242
6 Replies

Reply

Bookmark

Sort
Glitch8
 ( 6.70% )
- ago
#1
We will have to let Cone tackle this one when he gets back next week, he's the IB expert.
0
- ago
#2
OK, Glitch, thanks for your response.
0
Cone8
 ( 3.17% )
- ago
#3
Re: "Order can have only one flag: Outside RTH or Allow PreOpen."
We assign only Outside RTH if you check "Enable Pre/Post Market Trading" in your Trading Preferences. We don't (and cannot) assign Allow PreOpen.

My impression (confirmed) is that it is related to your TWS Presets for stocks.
See if this is checked in your Configuration > Presets > Stocks ...
(It is, so uncheck it, and "Apply to all".)



Re: (2) The LMT order price changed unexpectedly.
Are you running in the S. Monitor with "Use LivePositions". If so, multiple trades for the same stock will change the basis price reported by IB, and that will change the Limit.

"Use Live Positions" isn't compatible with strategies that hold multiple positions for the same symbol.
0
- ago
#4
Thanks, Cone! You’re right on both points.

(1) The option was indeed checked in the Stocks Presets. I’ve deactivated it now and will run the test again.

(2) That’s correct—"Use Live Positions" is enabled. However, I’m not entirely sure what will happen when I deactivate it. I recall you mentioning in a webinar that either "Use Live Positions" must be enabled, or if not, "Retain NSF Positions" should be used in the strategy settings. Do I remember that correctly? Are there any other alternatives to avoid using "Retain NSF Positions"?

Appreciate the help!
0
Cone8
 ( 3.17% )
- ago
#5
"must be enabled" - no. If I said that, I misspoke. Hit F12, go to Trading Preferences, then high F1 for the help. There's a pretty big explanation about how it works and that it's not compatible for all strategies.

"Retain" is another subject altogether and strategies can buy/sell differently if the backtest removes "NSF Positions". When trading, I advise to keep "Retain" checked. This way you're sure to get exit signals for trades that you made with the strategy.

A Trading Pref. that I do recommend to leave checked is "Block Exit Orders..." This will prevent "selling" a position you don't own. Especially when trading multiple positions, you need to study how to set up all these preferences to get the result you want for your trading.


0
- ago
#6
Sorry — I didn’t mean to misquote you. It’s not that you said "'Use Live Positions' must be enabled," but rather that I remembered it as "either 'Use Live Positions' or 'Retain NSF Positions' should be enabled to ensure exit trade signals are received."

Anyway, thanks for clarifying! I’ll review the help section in Trading Preferences to get a better understanding.
1

Reply

Bookmark

Sort