public override bool Equals(object obj) { if (obj.GetType() != typeof(TransactionPairBinary)) { return(false); } TransactionPairBinary trade = (TransactionPairBinary)obj; var entryPriceMatch = this.currentPosition == trade.currentPosition ? this.averageEntryPrice == trade.averageEntryPrice : true; return(this.LongVolume == trade.LongVolume && this.ShortVolume == trade.ShortVolume && entryPriceMatch && this.EntryTime == trade.EntryTime && this.exitPrice == trade.exitPrice && this.ExitTime == trade.ExitTime); }
public TransactionPairBinary(TransactionPairBinary other) { entryTime = other.entryTime; postedEntryTime = other.postedEntryTime; exitTime = other.exitTime; postedExitTime = other.postedExitTime; currentPosition = other.currentPosition; entryPrice = other.entryPrice; averageEntryPrice = other.averageEntryPrice; exitPrice = other.exitPrice; minPrice = other.minPrice; maxPrice = other.maxPrice; closedPoints = other.ClosedPoints; exitBar = other.exitBar; entryBar = other.entryBar; completed = other.completed; longVolume = other.LongVolume; shortVolume = other.ShortVolume; entryOrderId = other.entryOrderId; entrySerialNumber = other.entrySerialNumber; exitOrderId = other.exitOrderId; exitSerialNumber = other.entrySerialNumber; }