- ago
Suddenly, my Cover order was canceled, resulting in error messages for all my following orders

Maybe the reason is that we can not have on the same bar a Buy & a Cover



0
313
Solved
17 Replies

Reply

Bookmark

Sort
Glitch8
 ( 12.74% )
- ago
#1
From your log it appears there was a disconnection between WL and IB TWS.
0
- ago
#2
I will not say so, the timing was different

I am afraid that we can not have on the same Bar 2 Transactions

I have the same issue with other orders as well
0
Cone8
 ( 6.36% )
- ago
#3
It was a Cover At Limit at 19.07. The price didn't get there so it wasn't filled. On the next bar your strategy no longer transmitted the limit order, so it is canceled.
0
- ago
#4
OK - So what can I do this should not happen again?

so far as I understand you, as long the Cover order is not fulfilled, I can not open a new Buy Position
0
Cone8
 ( 6.36% )
- ago
#5
Previously, I was looking at the chronology from top to bottom. Now it's clear that you had a short position that was "Covered" by the Buy. At IB "Short" is the same as "Sell" and "Cover" is the same as "Buy".

If the idea is to buy at market to open a new long position, you better cover at market to close the short on the same bar. If you don't, the hypothetical strategy will become out-of-sync with reality.

Case in point - when the Buy Filled at market, you covered the short Position in your account; so your account was flat, not long. When the strategy tried to "Cover", there was no position in the account - not short or long, hence the errors for the exit signals.
0
Best Answer
- ago
#6
Is it possible to use a cover order with a market order for profit target?

is it not always a limit order when profit target is hit?

0
Cone8
 ( 6.36% )
- ago
#7
Your strategy is doing it [correctly] already.

It placed a Buy and Cover at Market at 08:20:02. I think the problem was that Wealth-Lab must have placed the Buy first and then the Cover. It looks like the Buy bought the Position so quickly that when WL checked for a position to Cover, the account was already flat.

We're going to have to investigate this scenario, but probably when a Buy and Cover occur on the same bar, we need to make sure to process the Cover first.
0
Glitch8
 ( 12.74% )
- ago
#8
Isn't this a case that the BROKER executed that trade first, how can we control that, it's event-driven?
0
Cone8
 ( 6.36% )
- ago
#9
Buy and Cover are the same order w.r.t. IB. There is only "BUY".

If it's just because the strategy itself created the Buy order before the Cover when processing the same bar, I think WL needs to sort those orders and place exit(s) first.
0
Glitch8
 ( 12.74% )
- ago
#10
It will need to then employ a software based One Triggers Other logic. Just submitting the Cover first won’t guarantee IB will fill it first, or that the position update will arrive in time. The Buy would need to be placed after the Cover fills.
0
Cone8
 ( 6.36% )
- ago
#11
In this market order scenario OTO is not required. Do you mean that WL requires that?

WL just has to know (and it does) that a short position already exists, that it matches the cover, and if it does place both orders.

If the short position didn't exist, I'd expect to see the result that kls06541 got.
0
Glitch8
 ( 12.74% )
- ago
#12
I thought it was already placing both orders and that was the problem.
0
Cone8
 ( 6.36% )
- ago
#13
See the sequence in the starter post - bottom to top in Order Manager. Both Market orders occur on the same bar (08:20:02) to reverse the position, but the Cover fails due to no matching position. I presume by what occurred that:

1. the Order Mgr processed the Buy first and placed it.
2. Somehow the order filled so quickly,
3. that when the Cover was processed, no matching position was at the broker because it was already flattened by the Buy.
0
Glitch8
 ( 12.74% )
- ago
#14
It's not that the Order Manager PROCESSED the Buy first, it's that the BROKER processed the Buy first, we can't control in what order the Broker processed these orders. What we can do, it defer submitting an order until another one fills.
0
Cone8
 ( 6.36% )
- ago
#15
I'm not getting through, so taking it offline to GitHub, please.
0
- ago
#16
Hopefully you will all come out with a solution as soon as possible, as I need it badly to work properly
0
Cone8
 ( 6.36% )
- ago
#17
At the moment, we haven't been able to duplicate the problem when using "native" IB symbols for both streaming and trading. It's possible the issue you experiences has something to do with the symbol mapping, we're not sure yet.

0

Reply

Bookmark

Sort