예제 #1
0
        /// <summary>
        /// Get the price necessary to sell amount currency. You would place a limit sell order for amount at the returned price to sell all of the amount.
        /// </summary>
        /// <param name="amount">Amount to sell</param>
        /// <returns>The price necessary to sell at to sell amount currency</returns>
        public decimal GetPriceToSell(decimal amount)
        {
            ExchangeOrderPrice bid;
            decimal            sellPrice = 0m;

            for (int i = 0; i < Bids.Count && amount > 0m; i++)
            {
                bid       = Bids.ElementAt(i).Value;
                sellPrice = bid.Price;
                amount   -= bid.Amount;
            }

            return(sellPrice);
        }