private void ClosePositionByStopLoss(DataSample sample) { Position.ClosePrice = Position.StopLossPrice; Position.CloseTimestamp = sample.Candle.Timestamp; PlayedPositions.Add(Position); this.OnClosePositionByStopLoss(Position); Position = null; }
private void ClosePosition(PositionDirection direction, bool byStopLoss, DataSample sample) { Position.ClosePrice = sample.Candle.Close; Position.CloseTimestamp = sample.Candle.Timestamp; PlayedPositions.Add(Position); this.OnClosePosition(Position); Position = null; }