Exemplo n.º 1
0
            public override int GetHashCode()
            {
                int hash = 0;

                if (hashCode > 0)
                {
                    hash = hashCode;
                }
                else
                {
                    hash =
                        (ChildOrderAcceptanceId.GetHashCode() * 2)
                        + ((ChildOrderId == null ? 1 : ChildOrderId.GetHashCode()) * 3)
                        + (RemainingSize.GetHashCode() * 5)
                        + (AveragePrice.GetHashCode() * 7);
                }
                return(hash);
            }
Exemplo n.º 2
0
 public override int GetHashCode()
 {
     // credit: http://stackoverflow.com/a/263416/677735
     unchecked // Overflow is fine, just wrap
     {
         int hash = 41;
         // Suitable nullity checks etc, of course :)
         if (Symbol != null)
         {
             hash = hash * 59 + Symbol.GetHashCode();
         }
         hash = hash * 59 + Quantity.GetHashCode();
         hash = hash * 59 + AveragePrice.GetHashCode();
         hash = hash * 59 + MarketPrice.GetHashCode();
         hash = hash * 59 + MarketValue.GetHashCode();
         hash = hash * 59 + EntryValue.GetHashCode();
         hash = hash * 59 + UpdateTime.GetHashCode();
         return(hash);
     }
 }
Exemplo n.º 3
0
        /// <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();
                if (AveragePriceUsd != null)
                {
                    hashCode = hashCode * 59 + AveragePriceUsd.GetHashCode();
                }
                if (EstimatedLiquidationPrice != null)
                {
                    hashCode = hashCode * 59 + EstimatedLiquidationPrice.GetHashCode();
                }
                if (FloatingProfitLoss != null)
                {
                    hashCode = hashCode * 59 + FloatingProfitLoss.GetHashCode();
                }
                if (FloatingProfitLossUsd != null)
                {
                    hashCode = hashCode * 59 + FloatingProfitLossUsd.GetHashCode();
                }
                if (OpenOrdersMargin != null)
                {
                    hashCode = hashCode * 59 + OpenOrdersMargin.GetHashCode();
                }
                if (TotalProfitLoss != null)
                {
                    hashCode = hashCode * 59 + TotalProfitLoss.GetHashCode();
                }
                if (RealizedProfitLoss != null)
                {
                    hashCode = hashCode * 59 + RealizedProfitLoss.GetHashCode();
                }
                if (Delta != null)
                {
                    hashCode = hashCode * 59 + Delta.GetHashCode();
                }
                if (InitialMargin != null)
                {
                    hashCode = hashCode * 59 + InitialMargin.GetHashCode();
                }
                if (Size != null)
                {
                    hashCode = hashCode * 59 + Size.GetHashCode();
                }
                if (MaintenanceMargin != null)
                {
                    hashCode = hashCode * 59 + MaintenanceMargin.GetHashCode();
                }

                hashCode = hashCode * 59 + Kind.GetHashCode();
                if (MarkPrice != null)
                {
                    hashCode = hashCode * 59 + MarkPrice.GetHashCode();
                }
                if (AveragePrice != null)
                {
                    hashCode = hashCode * 59 + AveragePrice.GetHashCode();
                }
                if (SettlementPrice != null)
                {
                    hashCode = hashCode * 59 + SettlementPrice.GetHashCode();
                }
                if (IndexPrice != null)
                {
                    hashCode = hashCode * 59 + IndexPrice.GetHashCode();
                }
                if (InstrumentName != null)
                {
                    hashCode = hashCode * 59 + InstrumentName.GetHashCode();
                }
                if (SizeCurrency != null)
                {
                    hashCode = hashCode * 59 + SizeCurrency.GetHashCode();
                }
                return(hashCode);
            }
        }