Conditional Order Trailing Stop

J

JoshF

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!
 
RmS59

RmS59

Member
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

Top