コード例 #1
0
        private void OnInboundApplicationMsg(Object sender, InboundApplicationMsgEventArgs e)
        {
            List <Message> replies = new List <Message>();

            switch (e.Msg.Type)
            {
            case MsgType.NewOrderSingle:
                Random rnd = new Random();
                int    x   = rnd.Next(1, 5);
                switch (x)
                {
                case 1:
                    replies.Add(CreateExecutionReport(e.Msg, OrdStatus.New));
                    break;

                case 2:
                    replies.Add(CreateExecutionReport(e.Msg, OrdStatus.New));
                    replies.Add(CreateExecutionReport(e.Msg, OrdStatus.Partial));
                    break;

                case 3:
                    replies.Add(CreateExecutionReport(e.Msg, OrdStatus.New));
                    replies.Add(CreateExecutionReport(e.Msg, OrdStatus.Filled));
                    break;

                case 4:
                    replies.Add(CreateExecutionReport(e.Msg, OrdStatus.Rejected));
                    break;
                }
                break;

            case MsgType.OrderCancelRequest:
                replies.Add(CreateCancelledExecutionReport(e.Msg));
                break;

            default:
                Message email = new Message(MsgType.Email, fixVersion);
                email[Tags.EmailThreadID] = "SellSide reply";
                email[Tags.EmailType]     = EmailType.New;
                email[Tags.Subject]       = "Message was received";

                email[Tags.EmailType] = EmailType.New;
                Group group = email.SetGroup(Tags.NoLinesOfText, 1);
                group.Set(Tags.Text, 0, "The message with MsgType=" + e.Msg[Tags.MsgType] + " was received");

                replies.Add(email);
                break;
            }

            Session sn = (Session)sender;

            foreach (Message reply in replies)
            {
                reply.Validate();
                sn.Send(reply);
            }
        }
コード例 #2
0
            static void InboundApplicationMsgEvent(object sender, InboundApplicationMsgEventArgs args)
            {
                if (!active)
                {
                    return;
                }

                TimestampHelper.GetTicks(ref marks[counter].RecvFinish);
                ++counter;
                ready.Set();
            }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: zeropool/Vigoth
 private void marketDataSession_InboundApplicationMsgEvent(object sender, InboundApplicationMsgEventArgs args)
 {
     eventView.LogIncomingMessage(args.Msg);
     if (MsgType.Market_Data_Request == args.Msg.Type)
     {
         marketDataFeed.ProcessMarketDataRequest(args.Msg);
     }
     if (MsgType.Security_Definition_Request == args.Msg.Type)
     {
         marketDataFeed.ProcessSecurityDefinitionRequest(args.Msg);
     }
 }
コード例 #4
0
ファイル: Throughput.cs プロジェクト: zeropool/Vigoth
            static void InboundApplicationMsgEvent(object sender, InboundApplicationMsgEventArgs args)
            {
                ++counter;

                if (counter == WarmupNumberOfMessages)
                {
                    receiveStart = TimestampHelper.Ticks;
                    return;
                }

                if (counter == WarmupNumberOfMessages + NumberOfMessages)
                {
                    receiveFinish = TimestampHelper.Ticks;
                    ready.Set();
                    return;
                }
            }
コード例 #5
0
        protected void OnInboundApplicationMsg(Object sender, InboundApplicationMsgEventArgs args)
        {
            Message incomingMessage = args.Msg;

            switch (incomingMessage.Type)
            {
            case MsgType.Market_Data_Incremental_Refresh:
                ProcessMarketDataIncrementalRefresh(incomingMessage);
                break;

            case MsgType.Market_Data_Snapshot_Full_Refresh:
                ProcessMarketDataFullRefresh(incomingMessage);
                break;

            case MsgType.Security_Definition:
                ProcessSecurityDefinition(incomingMessage);
                break;
            }
        }
コード例 #6
0
 private void session_InboundApplicationMsgEvent(object sender, InboundApplicationMsgEventArgs args)
 {
     try
     {
         if (MsgType.Execution_Report != args.Msg.Type)
         {
             return;
         }
         Order order = orderBook.UpdateOrder(args.Msg);
         if (null != order)
         {
             OrderStateChanged(this, new OrderStateChangedArgs(order));
         }
     }
     catch (Exception ex)
     {
         logger.LogError("Exception during the processing of incoming FIX message: " + ex);
         Trace.TraceError("Exception during the processing of incoming FIX message: " + ex);
     }
 }
コード例 #7
0
 private void OnInboundApplicationMsg(Object sender, InboundApplicationMsgEventArgs e)
 {
     _logger.Add("Incoming application-level message: " + e.Msg);
 }
コード例 #8
0
ファイル: BuySide.cs プロジェクト: zeropool/Vigoth
 private static void OnInboundApplicationMsg(Object sender, InboundApplicationMsgEventArgs e)
 {
     Console.WriteLine("Incoming application-level message:\n" + e.Msg);
     // Processing of the application-level incoming message ...
 }
コード例 #9
0
ファイル: Sample.cs プロジェクト: zeropool/Vigoth
        void acceptor_InboundApplicationMsgEvent(object sender, InboundApplicationMsgEventArgs args)
        {
            Console.WriteLine("\nAcceptor received " + args.Msg.ToString(Message.StringFormat.TAG_NAME, '|'));

            inboundApplicationMessageEvent.Set();
        }
コード例 #10
0
 void session_InboundApplicationMsgEvent(object sender, InboundApplicationMsgEventArgs args)
 {
     eventView.LogIncomingMessage(args.Msg);
 }
コード例 #11
0
ファイル: MainForm.cs プロジェクト: zeropool/Vigoth
 private void tradingSession_InboundApplicationMsgEvent(object sender, InboundApplicationMsgEventArgs args)
 {
     eventView.LogIncomingMessage(args.Msg);
     exchange.ProcessIncomingMessage(args.Msg);
 }