In pairs trading, two positions must be entered simultaneously. Getting a partial fill, or worse yet, a fill in only one of them will completely change your P/L with unlimited risk. Is it possible to place two limit orders to enter that are all-or-none? What about a basket of limit orders? Thanks.
--Is it possible to place two limit orders to enter that are all-or-none? --- sure,but again-you have to be more specific-to do what? at what price? ---What about a basket of limit orders?--- what about it? same thing-it depends on your prices and shares available at those prices. how about this- https://www.interactivebrokers.com/en/index.php?f=4985 http://ibkb.interactivebrokers.com/video/1037 https://www.interactivebrokers.com/...guidebook/ordertypes/advanced_order_types.htm
IB has this https://www.interactivebrokers.com/en/?f=/en/trading/orders/spread.php But in general, this is a hairy problem, I have a lot of code devoted to execution on spreads.
From what I've found you rarely want to simultaneously send orders out for multi-legged strategies which require limits. Suppose you're trading pairs, you basically want to leave the order out for one leg, use cancelReplaces to update the orders. Then write a listener waiting for an execution and only then do you trade the other leg. The issue with sending both out at the same time is you'll essentially having a moving target which will create unnecessary rebalancing (added transaction cost).
OP is talking about pair. 2 stocks,not much of a multi legged system.. let say i's trading % spread between...i don't know..SPY and IWM.my target spread was reached(let say 0.5% difference between two,IWM is lower,SPY-higher and i want to buy IWM and short SPY. just like today) what's the problem of simultaneously buy at ask IWM and sell at bid SPY? rebalancing?moving target?
All pairs are multi-legged systems, but not all multi-legged systems are pairs. It's the same in principle but the uncertainty of fills increases with the number of legs. Suppose you submit marketable limit orders for both legs and you're able to hit the bid on SPY but you either miss or get partially filled on IWM. Now in practice, this could happen on either sides and will. As you accumulate a position, your net delta (using your example) will be in flux. It's much more manageable to approach this problem as trying to catch up rather than what I described above.
got it.but on other hand one can write\add simple condition(assuming he is willing to buy at ask and sell at bid)-do it only when there is enough shares at both sides. but i agree-even then he can(and from time to time will) end partially filled on one leg
Because pairs trading/arbitrage is based on the analysis of the whole basket, all instruments must be filled as soon as criteria are fulfilled. The solution: Trade highly liquid instruments. Use market orders and automatic order submission and it will be ok. IB has basket trading tool.