var pos2 = sec.Security.Positions.GetLastActiveForSignal("tema", i);
if (pos2 != null)
{
var newStop = sec.Security.LowPrices[i] - sec.Security.LowPrices[i] / 100 * Stop.Value;
>>> var oldStop = sec.Security.Positions.GetLastForCloseSignal("temaStop", i);
if (oldStop != null)
{
if( newStop > oldStop.EntryPrice) //новый стоп выше, можно двигать
pos2.CloseAtStop(i + 1, newStop, "temaStop");
else
pos2.CloseAtStop(i + 1, oldStop.EntryPrice, "temaStop"); //сохраняем старый стоп
}
else
{
pos2.CloseAtStop(i + 1, newStop, "temaStop");
}
}