开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Converging Trailing Stop via API


 

Does anyone have experience in the mechanics of maintaining a converging trailing stop via the API??

I mean a stop where the trailing amount is wide at the start (to give a trade space to take hold) but then progressively reduces the trailing amount once the position becomes profitable, in order to protect the profit.? So, for example, a 25% trailing stop allows the trade to established, but then is reduced to, say, 20%, 15% and a minimum (say) 10% once the trade reaches certain profitability levels.? I think some people call it a tangential trailing stop.

Theoretically, I would guess the mechanics via the API would be something like this (but looking for comment/correction!):
  • Place initial entry order and (say) 25% trailing stop order as a parent/child order
    • specify OCA group/type on the trail stop order.
  • After entry, at each new profitability level:
    • Place a new trailing stop order with a new trailing % amount and with same OCA group/type as original trail stop order.
    • Cancel the original (and any other previous) trailing stop orders.

However, I'm not 100% sure of these mechanics and have these questions in my head:
  • Can I just keep adding trailing stops (without cancelling previous ones) provided they are all part of the same OCA group, and save the cancelling step above?
  • Are there any robustness concerns with regularly cancelling and replacing orders, or having multiple trailing stops sitting in an OCA group?? I don't want any trail stops to inadvertently enter a short position, obviously.
  • Or is there a better way that I haven't considered?

I would love any comments from anyone with experience, or even just views, on this.


Nick
 

If you are going to be monitoring the position yourself you just have to change the price on the stop order - you don't have to cancel and submit a new one.

Just send another PlaceOrder with everything the same as the original stop order except the new price. This will adjust the stop price.

You might look into IB's algo order types, they might have something that would work and then it would be handled on IB's end.

On 3/4/2022 12:05 AM, David Walker wrote:
Does anyone have experience in the mechanics of maintaining a converging trailing stop via the API?