If I use the following code:
SetProfitTarget("", CalculationMode.Ticks, 5, true);
Is the 5 tick counted from "Close[0]" or the "Position.AveragePrice"?
I tried using an explicit limit order to replace SetProfitTarget:
if (BuySignal == true)
{
EnterLongLimit(Close[0], "T2");
ExitLongLimit(Close[0] + (5.0 * TickSize), "T2");
}
Please refer to the attachment.
The strategy was supposed to exit the long position after 5 tick. But it did not until it hit the stop loss.
May I have some enlightenment on this?
I think of that maybe the limit order with the same signal name has not been cancelled after the previous trade ended with a stop loss. May that be the case? How can I cancelled the exit limit order when the trade is hit by a stop loss?
Thank you!
Comment