示例#1
0
        /// <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)
                 ));
        }
示例#2
0
        /// <summary>
        /// Returns true if Settlement instances are equal
        /// </summary>
        /// <param name="other">Instance of Settlement to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Settlement other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     SessionProfitLoss == other.SessionProfitLoss ||
                     SessionProfitLoss != null &&
                     SessionProfitLoss.Equals(other.SessionProfitLoss)
                     ) &&
                 (
                     MarkPrice == other.MarkPrice ||
                     MarkPrice != null &&
                     MarkPrice.Equals(other.MarkPrice)
                 ) &&
                 (
                     Funding == other.Funding ||
                     Funding != null &&
                     Funding.Equals(other.Funding)
                 ) &&
                 (
                     Socialized == other.Socialized ||
                     Socialized != null &&
                     Socialized.Equals(other.Socialized)
                 ) &&
                 (
                     SessionBankrupcy == other.SessionBankrupcy ||
                     SessionBankrupcy != null &&
                     SessionBankrupcy.Equals(other.SessionBankrupcy)
                 ) &&
                 (
                     Timestamp == other.Timestamp ||
                     Timestamp != null &&
                     Timestamp.Equals(other.Timestamp)
                 ) &&
                 (
                     ProfitLoss == other.ProfitLoss ||
                     ProfitLoss != null &&
                     ProfitLoss.Equals(other.ProfitLoss)
                 ) &&
                 (
                     Funded == other.Funded ||
                     Funded != null &&
                     Funded.Equals(other.Funded)
                 ) &&
                 (
                     IndexPrice == other.IndexPrice ||
                     IndexPrice != null &&
                     IndexPrice.Equals(other.IndexPrice)
                 ) &&
                 (
                     SessionTax == other.SessionTax ||
                     SessionTax != null &&
                     SessionTax.Equals(other.SessionTax)
                 ) &&
                 (
                     SessionTaxRate == other.SessionTaxRate ||
                     SessionTaxRate != null &&
                     SessionTaxRate.Equals(other.SessionTaxRate)
                 ) &&
                 (
                     InstrumentName == other.InstrumentName ||
                     InstrumentName != null &&
                     InstrumentName.Equals(other.InstrumentName)
                 ) &&
                 (
                     Position == other.Position ||
                     Position != null &&
                     Position.Equals(other.Position)
                 ) &&
                 (
                     Type == other.Type ||

                     Type.Equals(other.Type)
                 ));
        }
示例#3
0
        /// <summary>
        /// Returns true if Position instances are equal
        /// </summary>
        /// <param name="other">Instance of Position to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Position other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Direction == other.Direction ||

                     Direction.Equals(other.Direction)
                     ) &&
                 (
                     AveragePriceUsd == other.AveragePriceUsd ||
                     AveragePriceUsd != null &&
                     AveragePriceUsd.Equals(other.AveragePriceUsd)
                 ) &&
                 (
                     EstimatedLiquidationPrice == other.EstimatedLiquidationPrice ||
                     EstimatedLiquidationPrice != null &&
                     EstimatedLiquidationPrice.Equals(other.EstimatedLiquidationPrice)
                 ) &&
                 (
                     FloatingProfitLoss == other.FloatingProfitLoss ||
                     FloatingProfitLoss != null &&
                     FloatingProfitLoss.Equals(other.FloatingProfitLoss)
                 ) &&
                 (
                     FloatingProfitLossUsd == other.FloatingProfitLossUsd ||
                     FloatingProfitLossUsd != null &&
                     FloatingProfitLossUsd.Equals(other.FloatingProfitLossUsd)
                 ) &&
                 (
                     OpenOrdersMargin == other.OpenOrdersMargin ||
                     OpenOrdersMargin != null &&
                     OpenOrdersMargin.Equals(other.OpenOrdersMargin)
                 ) &&
                 (
                     TotalProfitLoss == other.TotalProfitLoss ||
                     TotalProfitLoss != null &&
                     TotalProfitLoss.Equals(other.TotalProfitLoss)
                 ) &&
                 (
                     RealizedProfitLoss == other.RealizedProfitLoss ||
                     RealizedProfitLoss != null &&
                     RealizedProfitLoss.Equals(other.RealizedProfitLoss)
                 ) &&
                 (
                     Delta == other.Delta ||
                     Delta != null &&
                     Delta.Equals(other.Delta)
                 ) &&
                 (
                     InitialMargin == other.InitialMargin ||
                     InitialMargin != null &&
                     InitialMargin.Equals(other.InitialMargin)
                 ) &&
                 (
                     Size == other.Size ||
                     Size != null &&
                     Size.Equals(other.Size)
                 ) &&
                 (
                     MaintenanceMargin == other.MaintenanceMargin ||
                     MaintenanceMargin != null &&
                     MaintenanceMargin.Equals(other.MaintenanceMargin)
                 ) &&
                 (
                     Kind == other.Kind ||

                     Kind.Equals(other.Kind)
                 ) &&
                 (
                     MarkPrice == other.MarkPrice ||
                     MarkPrice != null &&
                     MarkPrice.Equals(other.MarkPrice)
                 ) &&
                 (
                     AveragePrice == other.AveragePrice ||
                     AveragePrice != null &&
                     AveragePrice.Equals(other.AveragePrice)
                 ) &&
                 (
                     SettlementPrice == other.SettlementPrice ||
                     SettlementPrice != null &&
                     SettlementPrice.Equals(other.SettlementPrice)
                 ) &&
                 (
                     IndexPrice == other.IndexPrice ||
                     IndexPrice != null &&
                     IndexPrice.Equals(other.IndexPrice)
                 ) &&
                 (
                     InstrumentName == other.InstrumentName ||
                     InstrumentName != null &&
                     InstrumentName.Equals(other.InstrumentName)
                 ) &&
                 (
                     SizeCurrency == other.SizeCurrency ||
                     SizeCurrency != null &&
                     SizeCurrency.Equals(other.SizeCurrency)
                 ));
        }
示例#4
0
        /// <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)
                 ));
        }