public void AddOrder(TradeOrderBlock order) { if (order.OrderType == TradeOrderTypes.Sell) { ActiveSellOrders.Add(order.Hash, order); } else { ActiveBuyOrders.Add(order.Hash, order); } }
private void LoadOrders() { var orders = _AccountCollection.GetTradeOrderBlocks(); var cancellations = _AccountCollection.GetTradeOrderCancellations(); var executions = _AccountCollection.GetExecutedTradeOrderBlocks(); // now let's filter out all inactive orders foreach (var order in orders) { if (!cancellations.Contains(order.Hash) && !executions.Contains(order.Hash)) { if (order.OrderType == TradeOrderTypes.Sell) { ActiveSellOrders.Add(order.Hash, order); } else { ActiveBuyOrders.Add(order.Hash, order); } } } }