Exemplo n.º 1
0
        public void LoadMarketInformations()
        {
            if (OrderCache == default)
            {
                return;
            }

            OrderCache.UpdateActiveOrders();

            // Load active parent orders
            var parents = OrderCache.GetActiveParentOrders();

            foreach (var parent in parents)
            {
                var xParentOrder = new BfxParentOrder(parent);
                var txParent     = new BfxParentTransaction(this, xParentOrder);
                foreach (var xChildOrder in xParentOrder.Children.Cast <BfxChildOrder>())
                {
                    _childOrderTransactions[xChildOrder.AcceptanceId] = new BfxChildTransaction(this, xChildOrder, txParent);
                }
                _parentOrderTransactions.TryAdd(parent.AcceptanceId, txParent);
            }
            ;

            // Load standalone child orders
            var children = OrderCache.GetActiveIndependentChildOrders();

            foreach (var child in children)
            {
                var order = new BfxChildOrder(child);
                _childOrderTransactions.TryAdd(child.AcceptanceId, new BfxChildTransaction(this, order));
            }
        }
 public BfxChildTransaction(BfxMarket market, BfxChildOrder order, BfxParentTransaction parent)
     : base(market)
 {
     _order = order;
     Parent = parent;
 }