Exemplo n.º 1
0
 public PairRate(CurrencyPair currencyPair, BidAsk bidAsk)
 {
     ArgumentNullException.ThrowIfNull(currencyPair);
     ArgumentNullException.ThrowIfNull(bidAsk);
     this.CurrencyPair = currencyPair;
     this.BidAsk       = bidAsk;
 }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            BidAsk item = obj as BidAsk;

            if (item == null)
            {
                return(false);
            }
            return(Bid == item.Bid && Ask == item.Ask);
        }
Exemplo n.º 3
0
 public PairRate(CurrencyPair currencyPair, BidAsk bidAsk)
 {
     if (currencyPair == null)
     {
         throw new ArgumentNullException(nameof(currencyPair));
     }
     if (bidAsk == null)
     {
         throw new ArgumentNullException(nameof(bidAsk));
     }
     this.CurrencyPair = currencyPair;
     this.BidAsk       = bidAsk;
 }
Exemplo n.º 4
0
 public void SetRate(string exchangeName, CurrencyPair currencyPair, BidAsk bidAsk)
 {
     if (ByExchange.TryGetValue(exchangeName, out var rates))
     {
         var rate = rates.FirstOrDefault(r => r.CurrencyPair == currencyPair);
         if (rate != null)
         {
             rate.BidAsk = bidAsk;
         }
         var invPair = currencyPair.Inverse();
         var invRate = rates.FirstOrDefault(r => r.CurrencyPair == invPair);
         if (invRate != null)
         {
             invRate.BidAsk = bidAsk?.Inverse();
         }
     }
 }
Exemplo n.º 5
0
 public ExchangeRate(string exchange, CurrencyPair currencyPair, BidAsk bidAsk)
 {
     this.Exchange     = exchange;
     this.CurrencyPair = currencyPair;
     this.BidAsk       = bidAsk;
 }