Example #1
0
 private void ClosePositionByStopLoss(DataSample sample)
 {
     Position.ClosePrice     = Position.StopLossPrice;
     Position.CloseTimestamp = sample.Candle.Timestamp;
     PlayedPositions.Add(Position);
     this.OnClosePositionByStopLoss(Position);
     Position = null;
 }
Example #2
0
 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;
 }