Modifying a Pending order, looses the SL and TP
Created at 20 Jul 2016, 03:15
AN
Modifying a Pending order, looses the SL and TP
20 Jul 2016, 03:15
Hi,
If you run the code sample from your trading API page, the pending order looses its SL and TP.
public class Sample_cBot : Robot { protected override void OnStart() { var price = Symbol.Ask + 10 * Symbol.PipSize; DateTime? expiry = Server.Time.AddHours(12); PlaceStopOrder(TradeType.Buy, Symbol, 10000, price, "myLabel", 10, 10, expiry); } protected override void OnBar() { foreach (var order in PendingOrders) { if (order.Label == "myLabel") { double newPrice = Symbol.Ask + 5 * Symbol.PipSize; ModifyPendingOrder(order, newPrice, order.StopLossPips, order.TakeProfitPips, order.ExpirationTime); } } } }
Please advice.
Regards
Vivek