Experiencing if one of multiple simultaneous triggered orders (Quotes Window) for the same symbol gets filled, all remaining orders get cancelled. The red info box in TWS says "Cancelled by Trader".
Any idea?
Any idea?
Rename
Not enough information.
Are we talking about the same symbol? Triggers for different symbols?
I'm trying just to grasp the idea of multiple simultaneous triggers. Unless it happens right at the open, I can hardly even imagine "simultaneous" triggers.
Are we talking about the same symbol? Triggers for different symbols?
I'm trying just to grasp the idea of multiple simultaneous triggers. Unless it happens right at the open, I can hardly even imagine "simultaneous" triggers.
All triggers for the same symbol. For long, if the open is lower than the trigger threshold (off all orders), multiple orders get triggered simultaneously right at the open. Or, if two triggers are identical.
I asked Glitch to take a look, but I think we're going to have to call that scenario "Auto-Trade-incompatible" for now.
We'd have to make some changes to handle it.
You might have better luck with the Trading Preference > Misc Trading Settings > Convert Limit/Stop to Market if current quote exceeds price.
We'd have to make some changes to handle it.
You might have better luck with the Trading Preference > Misc Trading Settings > Convert Limit/Stop to Market if current quote exceeds price.
Okay, thanks for the explanation.
May I ask what exactly is the reason why the orders that have already been transmitted are then canceled?
May I ask what exactly is the reason why the orders that have already been transmitted are then canceled?
Because the Transactions have the same CancelationCode (probably null or 0), which causes the orders to be Canceled and Replaced, successively.
I just chatted with Glitch, who led me down that path, and I already tested that if you assign a different CancelationCode to each of the Transactions it will work.
Example:
I just chatted with Glitch, who led me down that path, and I already tested that if you assign a different CancelationCode to each of the Transactions it will work.
Example:
CODE:
Transaction t = PlaceTrade(bars, TransactionType.Buy, OrderType.Limit, bars.Close[idx] * 1.005); t.CancelationCode = 13; t = PlaceTrade(bars, TransactionType.Buy, OrderType.Limit, bars.Close[idx] * 1.01); t.CancelationCode = 14; t = PlaceTrade(bars, TransactionType.Buy, OrderType.Limit, bars.Close[idx] * 1.015); t.CancelationCode = 15;
This makes sense! So this is also working for orders which are generated from different strategies (MetaStrategy) with different Cancelation Codes for each strategy?
Yes, MetaStrategy components are considered separate groups.
Perfect, will test this option the next week, thanks! :-)
Edit: I tried assigning different Cancelation Codes (ranges) to each Child Strategy like this:
Strategy 1 --> 1-5
Strategy 2 --> 6-10
Strategy 3 --> 11-15
...
Unfortunately, the orders (for the same symbol) still cancel out each other.
Strategy 1 --> 1-5
Strategy 2 --> 6-10
Strategy 3 --> 11-15
...
Unfortunately, the orders (for the same symbol) still cancel out each other.
CODE:
{ ... if (buy) { Backtester.CancelationCode = 1; // 6, 11, ... _transaction = PlaceTrade(bars, TransactionType.Buy, OrderType.Limit, ...); _transaction.Weight = weight[index]; } } else { { Backtester.CancelationCode = 2; // 7, 12, ... if (exit) { ClosePosition(foundPosition0, OrderType.Market, ...); } } { Backtester.CancelationCode = 2; // 7, 12, ... ClosePosition(foundPosition0, OrderType.Limit, ...); } }
Your Response
Post
Edit Post
Login is required