Conditional Order Trailing Stop


New member
I was curious if anyone has the code to incorporate a trailing stop along with a SELL condition as part of a conditional order, not sure what that would look like.

Essentially it would be something like, where my trailing stop is previously defined.

AddOrder(OrderType.SELL_TO_CLOSE, condition = SellCond OR TrailingStop

Thanks all!


Why not do exactly what you are saying?

Create a variable

def ExitPriceLong = MAX(sellprice, trailingstopprice);

Then just use this price in your logic

Similar threads