Topics
Replies
obial
03 Sep 2014, 16:54
I tried it by removing the below part and it is still the same errors:
if (History.FindLast(Strategy1, Symbol).NetProfit > 0)
{
foreach (var order in PendingOrders)
{
if (order.Label == Strategy1 && order.Comment == Strategy1)
{
CancelPendingOrder(order);
}
}
looks like there needs to be smth defined for the below, because it works fine when there is an opened order with set SL and TP, but I cannot find anything into the documentation or smth to debug !
var TargetVolume = Symbol.NormalizeVolume(position.Volume * Multiplier, RoundingMode.Up);
var TargetSLSS = position.EntryPrice;
var expirationTime = Server.Time.AddSeconds(SecondsTimeout);
sellOrderTargetPrice = Math.Round(position.StopLoss.Value - PipsAway * Symbol.PipSize, Symbol.Digits);
buyOrderTargetPrice = Math.Round(position.StopLoss.Value + PipsAway * Symbol.PipSize, Symbol.Digits);
@obial
obial
04 Sep 2014, 14:32
That worked like a charm.
Thanks
@obial