Пример #1
0
        private void Receive(object sender, MessageReceivedEventArgs e)
        {
            try
            {
                ExecutionTickerReply reply = JsonConvert.DeserializeObject <ExecutionTickerReply>(e.Message);
                if (reply != null)
                {
                    EventHandler <ExecutionTickerReply> executionHandler = ExecutionUpdate;
                    if (executionHandler != null)
                    {
                        executionHandler(this, reply);
                    }

                    EventHandler <OrderReply> quoteHandler = OrderUpdate;
                    if (quoteHandler != null)
                    {
                        quoteHandler(this, reply.Order);
                    }
                }
            }
            catch (SocketException ex)
            {
                //reconnect
            }
            catch (Exception ex)
            {
                Error(sender, new ErrorEventArgs(new Exception("Unsupported message received.\nex: " + ex.Message + "\nMessage: " + e.Message)));
            }
        }
Пример #2
0
        private void UpdateExecution(ExecutionTickerReply reply)
        {
            EventHandler <ExecutionTickerReply> handler = ExecutionUpdated;

            if (handler != null)
            {
                handler(null, reply);
            }
            _dataAccess.UpdateExecution(reply);
        }
Пример #3
0
        private void ExecutionUpdated(object sender, ExecutionTickerReply executionTickerReply)
        {
            UpdateOrder(executionTickerReply.Order);

            // Logic here to determine compeditors orders
        }
Пример #4
0
 public void UpdateExecution(ExecutionTickerReply execution)
 {
 }