I have many problems with strategies that should have StopLoss and TrailStop since the Set() methods cannot be used simultaneously. What I am trying to do is use the SetTrailStop() and exit with ExitLongStop orders but it doesn´t really work.
Can anyone tell me what is wrong with my appoach? I use market orders to enter a long trade. I use OnExecution() to submit an ExitLongStop order, with LivetillCancelled set to true and using the execution.order.AvgFillprice minus some Stoploss. Traceorders is set to true, so I can see in the output window that the order is placed. No errors there.
In backtest the order is never there. As soon as I change to SetStopLoss, everything works wonderfully.
Can anyone give me any insight in how to deal with this situation? Shall I post the code?
Thank you. Any help welcome.

Comment