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
Maybe the reason is that we can not have on the same bar a Buy & a Cover
Rename
From your log it appears there was a disconnection between WL and IB TWS.
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
I am afraid that we can not have on the same Bar 2 Transactions
I have the same issue with other orders as well
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.
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
so far as I understand you, as long the Cover order is not fulfilled, I can not open a new Buy Position
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.
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.
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?
is it not always a limit order when profit target is hit?
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.
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.
Isn't this a case that the BROKER executed that trade first, how can we control that, it's event-driven?
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.
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.
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.
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.
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.
I thought it was already placing both orders and that was the problem.
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.
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.
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.
I'm not getting through, so taking it offline to GitHub, please.
Hopefully you will all come out with a solution as soon as possible, as I need it badly to work properly
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.
Your Response
Post
Edit Post
Login is required