Пример #1
0
        /// <summary>
        /// Returns true if TradesVolumes instances are equal
        /// </summary>
        /// <param name="other">Instance of TradesVolumes to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(TradesVolumes other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CallsVolume == other.CallsVolume ||
                     CallsVolume != null &&
                     CallsVolume.Equals(other.CallsVolume)
                     ) &&
                 (
                     PutsVolume == other.PutsVolume ||
                     PutsVolume != null &&
                     PutsVolume.Equals(other.PutsVolume)
                 ) &&
                 (
                     CurrencyPair == other.CurrencyPair ||

                     CurrencyPair.Equals(other.CurrencyPair)
                 ) &&
                 (
                     FuturesVolume == other.FuturesVolume ||
                     FuturesVolume != null &&
                     FuturesVolume.Equals(other.FuturesVolume)
                 ));
        }
Пример #2
0
        public void CurPair_RequestID()
        {
            CurrencyPair cp    = new CurrencyPair(Currency.EUR, Currency.BCH);
            string       reqID = cp.GetRequestID();
            CurrencyPair cp2   = CurrencyPair.RequestIDToCurrencyPair(reqID);

            Assert.IsTrue(cp.Equals(cp2));
        }
Пример #3
0
        //-------------------------------------------------------------------------
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ImmutableValidator private void validate()
        private void validate()
        {
            CurrencyPair pair = observation.Index.CurrencyPair;

            if (!pair.contains(settlementCurrencyNotional.Currency))
            {
                throw new System.ArgumentException("FxIndex and settlement notional currency are incompatible");
            }
            if (!(pair.Equals(agreedFxRate.Pair) || pair.isInverse(agreedFxRate.Pair)))
            {
                throw new System.ArgumentException("FxIndex and agreed FX rate are incompatible");
            }
        }
Пример #4
0
 public bool Equals(OrderQueueKey other)
 {
     return(other != null &&
            _currencyPair.Equals(other._currencyPair) &&
            _side == other._side);
 }
Пример #5
0
        public void Equals_WithNull_AreNotEqual()
        {
            var pair = new CurrencyPair("BTC", "USD");

            Assert.False(pair.Equals(null));
        }