/// <summary>
        /// Returns true if OrderItem instances are equal
        /// </summary>
        /// <param name="other">Instance of OrderItem to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrderItem other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ItemName == other.ItemName ||
                     ItemName != null &&
                     ItemName.Equals(other.ItemName)
                     ) &&
                 (
                     Qty == other.Qty ||
                     Qty.Equals(other.Qty)
                 ) &&
                 (
                     UnitPrice.Equals(other.UnitPrice)
                 ) &&
                 (
                     Cost.Equals(other.Cost)
                 ));
        }
Esempio n. 2
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 (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Instrument == other.Instrument ||
                     Instrument != null &&
                     Instrument.Equals(other.Instrument)
                 ) &&
                 (
                     Qty == other.Qty ||
                     Qty != null &&
                     Qty.Equals(other.Qty)
                 ) &&
                 (
                     Side == other.Side ||
                     Side != null &&
                     Side.Equals(other.Side)
                 ) &&
                 (
                     AvgPrice == other.AvgPrice ||
                     AvgPrice != null &&
                     AvgPrice.Equals(other.AvgPrice)
                 ) &&
                 (
                     UnrealizedPl == other.UnrealizedPl ||
                     UnrealizedPl != null &&
                     UnrealizedPl.Equals(other.UnrealizedPl)
                 ));
        }
Esempio n. 3
0
        /// <summary>
        /// Returns true if Execution instances are equal
        /// </summary>
        /// <param name="other">Instance of Execution to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Execution other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Instrument == other.Instrument ||
                     Instrument != null &&
                     Instrument.Equals(other.Instrument)
                 ) &&
                 (
                     Price == other.Price ||
                     Price != null &&
                     Price.Equals(other.Price)
                 ) &&
                 (
                     Time == other.Time ||
                     Time != null &&
                     Time.Equals(other.Time)
                 ) &&
                 (
                     Qty == other.Qty ||
                     Qty != null &&
                     Qty.Equals(other.Qty)
                 ) &&
                 (
                     Side == other.Side ||
                     Side != null &&
                     Side.Equals(other.Side)
                 ));
        }
Esempio n. 4
0
        /// <summary>
        /// Returns true if Order instances are equal
        /// </summary>
        /// <param name="other">Instance of Order to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Order other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Instrument == other.Instrument ||
                     Instrument != null &&
                     Instrument.Equals(other.Instrument)
                 ) &&
                 (
                     Qty == other.Qty ||
                     Qty != null &&
                     Qty.Equals(other.Qty)
                 ) &&
                 (
                     Side == other.Side ||
                     Side != null &&
                     Side.Equals(other.Side)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ) &&
                 (
                     FilledQty == other.FilledQty ||
                     FilledQty != null &&
                     FilledQty.Equals(other.FilledQty)
                 ) &&
                 (
                     AvgPrice == other.AvgPrice ||
                     AvgPrice != null &&
                     AvgPrice.Equals(other.AvgPrice)
                 ) &&
                 (
                     LimitPrice == other.LimitPrice ||
                     LimitPrice != null &&
                     LimitPrice.Equals(other.LimitPrice)
                 ) &&
                 (
                     StopPrice == other.StopPrice ||
                     StopPrice != null &&
                     StopPrice.Equals(other.StopPrice)
                 ) &&
                 (
                     ParentId == other.ParentId ||
                     ParentId != null &&
                     ParentId.Equals(other.ParentId)
                 ) &&
                 (
                     ParentType == other.ParentType ||
                     ParentType != null &&
                     ParentType.Equals(other.ParentType)
                 ) &&
                 (
                     Duration == other.Duration ||
                     Duration != null &&
                     Duration.Equals(other.Duration)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ));
        }