Да. У меня есть одна мысль. Мой код stoploss:
IPosition position = source.Positions.LastPositionActive;
double stopLossPrice = stopLossBase * koeff;
if (position.IsShort) {
stopLossPrice = position.EntryPrice + stopLossPrice;
} else {
stopLossPrice = position.EntryPrice - stopLossPrice;
}
position.CloseAtStop(
barIndex,
stopLossPrice,
SignalUtils.STOP_LOSS_CLOSE
);
Может ли быть такое, что position.IsShort вернул true для позиции типа лонг?
Как у вас вообще дела с многопотчоностью? Если выполняются два скрипта, надо ли думать о том, чтобы все что внутри было thread-safe?