Exemple #1
0
        public async Task RequestedFills(string applicationName, string symbol)
        {
            AbstractExchangePlugin abstractExchangePlugin =
                _exchangePluginService.PluginExchanges.FirstOrDefault(x => x.ApplicationName == applicationName);

            if (abstractExchangePlugin == null)
            {
                return;
            }
            Product product = new Product {
                ID = symbol
            };
            List <Fill> fills = await abstractExchangePlugin.UpdateFillsAsync(product);

            await Clients.Caller.NotifyFills(abstractExchangePlugin.ApplicationName, fills);
        }
Exemple #2
0
        public async Task RequestedPlaceOrder(string applicationName, Order order)
        {
            AbstractExchangePlugin abstractExchangePlugin =
                _exchangePluginService.PluginExchanges.FirstOrDefault(x => x.ApplicationName == applicationName);

            if (abstractExchangePlugin == null)
            {
                return;
            }
            Product product = new Product {
                ID = order.ProductID
            };
            await abstractExchangePlugin.PostOrdersAsync(order);

            List <Order> postedOrders = abstractExchangePlugin.Orders;
            await Clients.Caller.NotifyOrders(applicationName, postedOrders);

            List <Fill> fills = await abstractExchangePlugin.UpdateFillsAsync(product);

            await Clients.Caller.NotifyFills(applicationName, fills);
        }