- ago
Hi,

I’ve run into a situation where the 'Block Exit Orders when Position not Found' setting (under Trading preferences) doesn’t seem to prevent a sell order without position from being placed.

I set up a long-only strategy in the Strategy Monitor and executed it manually for the first time while my account was flat. The strategy generated four buy entry signals and one sell exit signal (see screenshot).



After clicking 'Select All' → 'Place Orders', all five orders were sent to the Order Manager and then to TWS, where both the four buy orders and the single sell order were created (screenshots attached).





However, the Order Manager detected that there was no corresponding position for ANSS (message: Portfolio Sync cloud not find a Position), yet an exit order was still placed in TWS.

What could have caused this? Am I missing any other setting that needs to be enabled? I’ve attached my current preferences settings for reference.



Thanks in advance!
0
130
5 Replies

Reply

Bookmark

Sort
Cone8
 ( 3.17% )
- ago
#1
That's a good one. Unfortunately, I can't duplicate it.

Just to be complete, what are the Broker thresholds for that account? Only the Default thresholds are showing in the image.

Reviewing the code, the only way it seems possible that this could happen is that "Block Exit Orders" was not enabled when you placed the orders. If it was, the order status would be "Error" (for sure).

If you still have that scenario active, double click on the the ANSS order and check all the broker messages available.
0
- ago
#2
Hi Cone,

There are no specific settings for this account (btw, it's a paper account) — see screenshot.



Here are all the available messages:





In case it helps:
I have two IB accounts. In one account, the same scenario works fine — the ANSS order is not routed to TWS. However, in the other account, the issue occurs as described.

Between testing both accounts, I closed and restarted both WL and TWS from scratch, without changing any preferences. The TWS API settings are identical for both accounts.

The only difference I’m aware of:
For the working account, I’m subscribed to market data. For the non-working account, I am not. Clould this be the reasen? The strategy trades daily only.

Any ideas?
0
Cone8
 ( 3.17% )
- ago
#3
QUOTE:
Between testing both accounts, I closed and restarted both WL and TWS from scratch
Excellent. I would have asked.

No more ideas. I pass this to Glitch.
0
- ago
#4
I’ve found the reason this happened!

Although I closed and restarted both WL and TWS between tests, I was always using the same saved workspace with the same strategy. As a result, the account that was originally used to set up the strategy in the workspace worked fine, while the other account didn’t.

I tested this by setting up the strategy from scratch, without the saved workspace, and now everything works as expected. So I guess this is working as designed.

Sorry for the trouble, and thanks for your help!
1
Cone8
 ( 3.17% )
- ago
#5
Thanks for the follow up. Good to know!
0

Reply

Bookmark

Sort