Esempio n. 1
0
 public bool Equals(Ohlcv other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(string.Equals(ExchangeId, other.ExchangeId) && string.Equals(TradeType, other.TradeType) &&
            string.Equals(BaseAsset, other.BaseAsset) && string.Equals(QuoteAsset, other.QuoteAsset) &&
            TimePeriodStart.Equals(other.TimePeriodStart) && TimePeriodEnd.Equals(other.TimePeriodEnd) &&
            TimeOpen.Equals(other.TimeOpen) && TimeClose.Equals(other.TimeClose) && PriceOpen.Equals(other.PriceOpen) &&
            PriceClose.Equals(other.PriceClose) && PriceLow.Equals(other.PriceLow) && PriceHigh.Equals(other.PriceHigh) &&
            VolumeTraded.Equals(other.VolumeTraded) && TradesCount.Equals(other.TradesCount) && string.Equals(Id, other.Id));
 }
Esempio n. 2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = ExchangeId != null?ExchangeId.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (TradeType != null ? TradeType.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (BaseAsset != null ? BaseAsset.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (QuoteAsset != null ? QuoteAsset.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ TimePeriodStart.GetHashCode();
                hashCode = (hashCode * 397) ^ TimePeriodEnd.GetHashCode();
                hashCode = (hashCode * 397) ^ TimeOpen.GetHashCode();
                hashCode = (hashCode * 397) ^ TimeClose.GetHashCode();
                hashCode = (hashCode * 397) ^ PriceOpen.GetHashCode();
                hashCode = (hashCode * 397) ^ PriceClose.GetHashCode();
                hashCode = (hashCode * 397) ^ PriceLow.GetHashCode();
                hashCode = (hashCode * 397) ^ PriceHigh.GetHashCode();
                hashCode = (hashCode * 397) ^ VolumeTraded.GetHashCode();
                hashCode = (hashCode * 397) ^ TradesCount.GetHashCode();
                hashCode = (hashCode * 397) ^ (Id != null ? Id.GetHashCode() : 0);
                return(hashCode);
            }
        }