Essentially I want to place a trailing stop limit to sell with a trigger above the current market price. Example: XYZ trading at 100. I have no position. When the price rises to 110, I want to trigger a sell limit if touched order @ 105 (same limit/trigger price). If the price rises to 115, I want this sell limit if touched to rise further to 110 and so on. If the price falls, I don't want it to move. Is there any way to do this with IB? Specifically, using the API.
With IB, I think you use a pegged order type. I don't know if it's available with API. You need to check the documentation for API.
Pegged orders will move both up and down with the price they pegged to though, no? I want it to move up but not down (and vice versa for buy orders)
Right, but it's a trailing stop order without a parent order. I.e. when the price hits the initial limit (110 in my example), I want the trailing stop order to become active, but I don't want any fill until the stop price is hit. Maybe I'm being dumb, i just can't work it out
It is called an OCO or One Cancels the Other Order. What you do is put two orders in at once like a combination order. One is a limit order which sells when the limit price is hit or higher. The other being a Trailing Stop Order. Chances are good one or the other price trigger will get hit and the order executed immediately. Now, the pending order which is still open will be automatically, cancelled since, the other order has already executed and cannot fulfill the pending order! Take note you have to have OCO otherwise, you might have two pending orders execute and you will have to suffer the consequences of that order!
Trailing stop order won't get filled until the price hits the stop price, hence *trailing* stop order. This is the description of all of IB's order types: https://www.interactivebrokers.com/en/index.php?f=4985.
I know that, I mean I want the trailing stop order to become active without having any parent. So when the price hits the stop price, I am opening a short position of X shares, NOT closing a long position of X shares. I'm not sure how else I can explain it. I've read through all of IB's order types, there doesn't seem to be anything that suits. I guess it can be done with some combo perhaps, but I can't figure it out. I'm trying to follow this but I'm struggling. Could you give me an example?
So a 5pt or $5 from the prev high, you want to short in the theory that you'll be jumping on a downtrend at that time, good logic, then I'd also set a SL just over that previous high incase it's a pull back before continuation. Doubt it's an order type, sure you could write a EA code thing and it'll take care of it in your absence, or find someone who codes IB to do it for you, shouldn't take long. ( not got IB sorry )