I am having a helluva time trying to set SetTrailingStop() and ExitShort/LongLimit() at the same time.
The error I'm getting is the one where it tells you your Exit() method has been ignored and I need to see internal order handling rules.
Here is the code in OnExecutionUpdate():
SetTrailStop(sell, CalculationMode.Ticks, TrailStopValue, false);
if (TargetTicks > 0)
{
double limitPrice = execution.Order.AverageFillPrice - TargetTicks * TickSize;
ExitShortLimit(0, true, Qty, limitPrice, "Profit target", sell);
}
I'm thinking that should work. Am I wrong? Are the two not compatible? I searched the forum and didn't see anyone else having this issue...

Comment