Exemplo n.º 1
0
        public void OnMessage(MarketDataSnapshotFullRefresh 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()) + ":: MarketDataSnapshotFullRefresh (" + 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.Symbol.ToString()) + ":: " + msg.GetString(Tags.Symbol));
            Console.WriteLine(parser.getFieldName(Tags.NoMDEntries.ToString()) + ":: " + msg.GetString(Tags.NoMDEntries));

            MarketDataSnapshotFullRefresh.NoMDEntriesGroup g0 = new MarketDataSnapshotFullRefresh.NoMDEntriesGroup();
            for (int grpIndex = 1; grpIndex <= msg.GetInt(Tags.NoMDEntries); grpIndex += 1)
            {
                Console.WriteLine("---------- ----------");
                msg.GetGroup(grpIndex, g0);
                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));
        }
Exemplo n.º 2
0
        public void OnMessage(MarketDataSnapshotFullRefresh 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()) + ":: MarketDataSnapshotFullRefresh (" + 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.Symbol.ToString()) + ":: " + msg.GetString(Tags.Symbol));
            Console.WriteLine(parser.getFieldName(Tags.NoMDEntries.ToString()) + ":: " + msg.GetString(Tags.NoMDEntries));

            MarketDataSnapshotFullRefresh.NoMDEntriesGroup g0 = new MarketDataSnapshotFullRefresh.NoMDEntriesGroup();
            for (int grpIndex = 1; grpIndex <= msg.GetInt(Tags.NoMDEntries); grpIndex += 1)
            {
                Console.WriteLine("---------- ----------");
                msg.GetGroup(grpIndex, g0);
                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));
        }