コード例 #1
0
        public void OnMessage(MarketDataIncrementalRefresh msg, SessionID sessionID)
        {
            FIX44XMLParser parser = new FIX44XMLParser();

            Console.WriteLine("==========Header::==========");
            Console.WriteLine(parser.getFieldName(Tags.BeginString.ToString()) + ":: " + msg.Header.GetString(Tags.BeginString));
            Console.WriteLine(parser.getFieldName(Tags.BodyLength.ToString()) + ":: " + msg.Header.GetString(Tags.BodyLength));
            Console.WriteLine(parser.getFieldName(Tags.MsgType.ToString()) + ":: MarketDataIncrementalRefresh (" + msg.Header.GetString(Tags.MsgType) + ")");
            Console.WriteLine(parser.getFieldName(Tags.MsgSeqNum.ToString()) + ":: " + msg.Header.GetString(Tags.MsgSeqNum));
            Console.WriteLine(parser.getFieldName(Tags.SenderCompID.ToString()) + ":: " + msg.Header.GetString(Tags.SenderCompID));
            Console.WriteLine(parser.getFieldName(Tags.SendingTime.ToString()) + ":: " + msg.Header.GetString(Tags.SendingTime));
            Console.WriteLine(parser.getFieldName(Tags.TargetCompID.ToString()) + ":: " + msg.Header.GetString(Tags.TargetCompID));

            Console.WriteLine("==========Body:: ==========");
            Console.WriteLine(parser.getFieldName(Tags.NoMDEntries.ToString()) + ":: " + msg.GetString(Tags.NoMDEntries));

            MarketDataIncrementalRefresh.NoMDEntriesGroup g0 = new MarketDataIncrementalRefresh.NoMDEntriesGroup();
            for (int grpIndex = 1; grpIndex <= msg.GetInt(Tags.NoMDEntries); grpIndex += 1)
            {
                Console.WriteLine("---------- ----------");
                msg.GetGroup(grpIndex, g0);
                //				Console.WriteLine(parser.getFieldName(Tags.MDUpdateAction.ToString())+":: "+g0.GetString(Tags.MDUpdateAction));

                Console.WriteLine(parser.getFieldName(Tags.MDUpdateAction.ToString()) + ":: " +
                                  parser.getFieldName(Tags.MDUpdateAction.ToString(), g0.GetString(Tags.MDUpdateAction).ToString()) +
                                  "(" + g0.GetString(Tags.MDUpdateAction) + ")"
                                  );

                Console.WriteLine(parser.getFieldName(Tags.MDEntryType.ToString()) + ":: " +
                                  parser.getFieldName(Tags.MDEntryType.ToString(), g0.GetString(Tags.MDEntryType).ToString()) +
                                  "(" + g0.GetString(Tags.MDEntryType) + ")"
                                  );

                try
                {
                    Console.WriteLine(parser.getFieldName(Tags.MDEntryPx.ToString()) + ":: " + g0.GetString(Tags.MDEntryPx));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(parser.getFieldName(Tags.MDEntrySize.ToString()) + ":: " + g0.GetString(Tags.MDEntrySize));
                }

                Console.WriteLine(parser.getFieldName(Tags.MDEntryDate.ToString()) + ":: " + g0.GetString(Tags.MDEntryDate));
                Console.WriteLine(parser.getFieldName(Tags.MDEntryTime.ToString()) + ":: " + g0.GetString(Tags.MDEntryTime));
            }

            Console.WriteLine("==========Trailer:: ==========");
            Console.WriteLine(parser.getFieldName(Tags.CheckSum.ToString()) + ":: " + msg.Trailer.GetString(Tags.CheckSum));
        }
コード例 #2
0
        public void OnMessage(MarketDataIncrementalRefresh msg, SessionID sessionID)
        {
            FIX44XMLParser parser = new FIX44XMLParser();

            Console.WriteLine("==========Header::==========");
            Console.WriteLine(parser.getFieldName(Tags.BeginString.ToString()) + ":: " + msg.Header.GetString(Tags.BeginString));
            Console.WriteLine(parser.getFieldName(Tags.BodyLength.ToString()) + ":: " + msg.Header.GetString(Tags.BodyLength));
            Console.WriteLine(parser.getFieldName(Tags.MsgType.ToString()) + ":: MarketDataIncrementalRefresh (" + msg.Header.GetString(Tags.MsgType) + ")");
            Console.WriteLine(parser.getFieldName(Tags.MsgSeqNum.ToString()) + ":: " + msg.Header.GetString(Tags.MsgSeqNum));
            Console.WriteLine(parser.getFieldName(Tags.SenderCompID.ToString()) + ":: " + msg.Header.GetString(Tags.SenderCompID));
            Console.WriteLine(parser.getFieldName(Tags.SendingTime.ToString()) + ":: " + msg.Header.GetString(Tags.SendingTime));
            Console.WriteLine(parser.getFieldName(Tags.TargetCompID.ToString()) + ":: " + msg.Header.GetString(Tags.TargetCompID));

            Console.WriteLine("==========Body:: ==========");
            Console.WriteLine(parser.getFieldName(Tags.NoMDEntries.ToString()) + ":: " + msg.GetString(Tags.NoMDEntries));

            MarketDataIncrementalRefresh.NoMDEntriesGroup g0 = new MarketDataIncrementalRefresh.NoMDEntriesGroup();
            for (int grpIndex = 1; grpIndex <= msg.GetInt(Tags.NoMDEntries); grpIndex += 1)
            {
                Console.WriteLine("---------- ----------");
                msg.GetGroup(grpIndex, g0);
                //				Console.WriteLine(parser.getFieldName(Tags.MDUpdateAction.ToString())+":: "+g0.GetString(Tags.MDUpdateAction));

                Console.WriteLine(parser.getFieldName(Tags.MDUpdateAction.ToString()) + ":: " +
                    parser.getFieldName(Tags.MDUpdateAction.ToString(), g0.GetString(Tags.MDUpdateAction).ToString()) +
                    "(" + g0.GetString(Tags.MDUpdateAction) + ")"
                );

                Console.WriteLine(parser.getFieldName(Tags.MDEntryType.ToString()) + ":: " +
                    parser.getFieldName(Tags.MDEntryType.ToString(), g0.GetString(Tags.MDEntryType).ToString()) +
                    "(" + g0.GetString(Tags.MDEntryType) + ")"
                );

                try
                {
                    Console.WriteLine(parser.getFieldName(Tags.MDEntryPx.ToString()) + ":: " + g0.GetString(Tags.MDEntryPx));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(parser.getFieldName(Tags.MDEntrySize.ToString()) + ":: " + g0.GetString(Tags.MDEntrySize));
                }

                Console.WriteLine(parser.getFieldName(Tags.MDEntryDate.ToString()) + ":: " + g0.GetString(Tags.MDEntryDate));
                Console.WriteLine(parser.getFieldName(Tags.MDEntryTime.ToString()) + ":: " + g0.GetString(Tags.MDEntryTime));
            }

            Console.WriteLine("==========Trailer:: ==========");
            Console.WriteLine(parser.getFieldName(Tags.CheckSum.ToString()) + ":: " + msg.Trailer.GetString(Tags.CheckSum));
        }