public Match(string instrument, long matchId, decimal price, long size, OrderSide side, TickDirection tickDirection, DateTime timestamp) { Instrument = instrument; MatchId = matchId; Price = price; Size = size; Side = side; TickDirection = tickDirection; Timestamp = timestamp; }
public override int GetHashCode() { int hash = 1; if (timestamp_ != null) { hash ^= Timestamp.GetHashCode(); } if (Side != 0) { hash ^= Side.GetHashCode(); } if (Size != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Size); } if (Price != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Price); } if (TickDirection != 0) { hash ^= TickDirection.GetHashCode(); } if (TradeMatchId.Length != 0) { hash ^= TradeMatchId.GetHashCode(); } if (GrossValue != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(GrossValue); } if (HomeNotional != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(HomeNotional); } if (ForeignNotional != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ForeignNotional); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) hashCode = hashCode * 59 + Direction.GetHashCode(); hashCode = hashCode * 59 + TickDirection.GetHashCode(); if (Timestamp != null) { hashCode = hashCode * 59 + Timestamp.GetHashCode(); } if (Price != null) { hashCode = hashCode * 59 + Price.GetHashCode(); } if (TradeSeq != null) { hashCode = hashCode * 59 + TradeSeq.GetHashCode(); } if (TradeId != null) { hashCode = hashCode * 59 + TradeId.GetHashCode(); } if (Iv != null) { hashCode = hashCode * 59 + Iv.GetHashCode(); } if (IndexPrice != null) { hashCode = hashCode * 59 + IndexPrice.GetHashCode(); } if (Amount != null) { hashCode = hashCode * 59 + Amount.GetHashCode(); } if (InstrumentName != null) { hashCode = hashCode * 59 + InstrumentName.GetHashCode(); } return(hashCode); } }
private void setComboBoxItemTick(ComboBox combo, TickDirection tickDirection) { combo.Text = tickDirection.ToString(); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) hashCode = hashCode * 59 + Direction.GetHashCode(); hashCode = hashCode * 59 + FeeCurrency.GetHashCode(); if (OrderId != null) { hashCode = hashCode * 59 + OrderId.GetHashCode(); } if (Timestamp != null) { hashCode = hashCode * 59 + Timestamp.GetHashCode(); } if (Price != null) { hashCode = hashCode * 59 + Price.GetHashCode(); } if (Iv != null) { hashCode = hashCode * 59 + Iv.GetHashCode(); } if (TradeId != null) { hashCode = hashCode * 59 + TradeId.GetHashCode(); } if (Fee != null) { hashCode = hashCode * 59 + Fee.GetHashCode(); } hashCode = hashCode * 59 + OrderType.GetHashCode(); if (TradeSeq != null) { hashCode = hashCode * 59 + TradeSeq.GetHashCode(); } if (SelfTrade != null) { hashCode = hashCode * 59 + SelfTrade.GetHashCode(); } hashCode = hashCode * 59 + State.GetHashCode(); if (Label != null) { hashCode = hashCode * 59 + Label.GetHashCode(); } if (IndexPrice != null) { hashCode = hashCode * 59 + IndexPrice.GetHashCode(); } if (Amount != null) { hashCode = hashCode * 59 + Amount.GetHashCode(); } if (InstrumentName != null) { hashCode = hashCode * 59 + InstrumentName.GetHashCode(); } hashCode = hashCode * 59 + TickDirection.GetHashCode(); if (MatchingId != null) { hashCode = hashCode * 59 + MatchingId.GetHashCode(); } hashCode = hashCode * 59 + Liquidity.GetHashCode(); return(hashCode); } }
/// <summary> /// Returns true if UserTrade instances are equal /// </summary> /// <param name="other">Instance of UserTrade to be compared</param> /// <returns>Boolean</returns> public bool Equals(UserTrade other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Direction == other.Direction || Direction.Equals(other.Direction) ) && ( FeeCurrency == other.FeeCurrency || FeeCurrency.Equals(other.FeeCurrency) ) && ( OrderId == other.OrderId || OrderId != null && OrderId.Equals(other.OrderId) ) && ( Timestamp == other.Timestamp || Timestamp != null && Timestamp.Equals(other.Timestamp) ) && ( Price == other.Price || Price != null && Price.Equals(other.Price) ) && ( Iv == other.Iv || Iv != null && Iv.Equals(other.Iv) ) && ( TradeId == other.TradeId || TradeId != null && TradeId.Equals(other.TradeId) ) && ( Fee == other.Fee || Fee != null && Fee.Equals(other.Fee) ) && ( OrderType == other.OrderType || OrderType.Equals(other.OrderType) ) && ( TradeSeq == other.TradeSeq || TradeSeq != null && TradeSeq.Equals(other.TradeSeq) ) && ( SelfTrade == other.SelfTrade || SelfTrade != null && SelfTrade.Equals(other.SelfTrade) ) && ( State == other.State || State.Equals(other.State) ) && ( Label == other.Label || Label != null && Label.Equals(other.Label) ) && ( IndexPrice == other.IndexPrice || IndexPrice != null && IndexPrice.Equals(other.IndexPrice) ) && ( Amount == other.Amount || Amount != null && Amount.Equals(other.Amount) ) && ( InstrumentName == other.InstrumentName || InstrumentName != null && InstrumentName.Equals(other.InstrumentName) ) && ( TickDirection == other.TickDirection || TickDirection.Equals(other.TickDirection) ) && ( MatchingId == other.MatchingId || MatchingId != null && MatchingId.Equals(other.MatchingId) ) && ( Liquidity == other.Liquidity || Liquidity.Equals(other.Liquidity) )); }
/// <summary> /// Returns true if PublicTrade instances are equal /// </summary> /// <param name="other">Instance of PublicTrade to be compared</param> /// <returns>Boolean</returns> public bool Equals(PublicTrade other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Direction == other.Direction || Direction.Equals(other.Direction) ) && ( TickDirection == other.TickDirection || TickDirection.Equals(other.TickDirection) ) && ( Timestamp == other.Timestamp || Timestamp != null && Timestamp.Equals(other.Timestamp) ) && ( Price == other.Price || Price != null && Price.Equals(other.Price) ) && ( TradeSeq == other.TradeSeq || TradeSeq != null && TradeSeq.Equals(other.TradeSeq) ) && ( TradeId == other.TradeId || TradeId != null && TradeId.Equals(other.TradeId) ) && ( Iv == other.Iv || Iv != null && Iv.Equals(other.Iv) ) && ( IndexPrice == other.IndexPrice || IndexPrice != null && IndexPrice.Equals(other.IndexPrice) ) && ( Amount == other.Amount || Amount != null && Amount.Equals(other.Amount) ) && ( InstrumentName == other.InstrumentName || InstrumentName != null && InstrumentName.Equals(other.InstrumentName) )); }