public Order GetMatchingOrder(UserHandler handler, TradeOffer trade) { Order buy = BuyOrders.FirstOrDefault((o) => o.TradeOfferMatches(handler, trade) == true); if (buy != null) { return(buy); } return(SellOrders.FirstOrDefault((o) => o.TradeOfferMatches(handler, trade) == true)); }
public MarketOrder LowestSellOrder(int?minimumQuantity) { MarketOrder item = null; if (SellOrders != null) { var filter = minimumQuantity ?? UseableQuantity; item = SellOrders.FirstOrDefault(arg => arg.Quantity > filter && arg.Security > SecurityLevel); } return(item); }