Ejemplo n.º 1
0
        public virtual void toAdmin(Message message, SessionID sessionId)
        {
            #region Documentation
            // provides you with a peak at the administrative messages that are being sent from your FIX engine to the
            // counter party. This is normally not useful for an application however it is provided for any logging you may
            // wish to do. Notice that the FIX::Message is not const. This allows you to add fields before an adminstrative
            // message before it is sent out.
            #endregion

            bool print = true;
            if (message.getHeader().isSetField(35))
            {
                MsgType msgtype = new MsgType();
                message.getHeader().getField(msgtype);
                if (msgtype.getValue() == "0" || msgtype.getValue() == "A")
                {
                    print = false;
                }
                else if (msgtype.getValue() == MsgType.LOGON)
                {
                }
            }

            if (print)
            {
                Console.WriteLine("ToAdmin: " + message);
            }
        }
Ejemplo n.º 2
0
        public void toAdmin(QuickFix.Message message, SessionID sessionID)
        {
            #region Documentation
            // provides you with a peak at the administrative messages that are being sent from your FIX engine to the
            // counter party. This is normally not useful for an application however it is provided for any logging you may
            // wish to do. Notice that the FIX::Message is not const. This allows you to add fields before an adminstrative
            // message before it is sent out.
            #endregion

            bool print = true;
            if (message.getHeader().isSetField(35))
            {
                MsgType msgtype = new MsgType();
                message.getHeader().getField(msgtype);
                if (msgtype.getValue() == "0")
                {
                    print = false;
                }
                else if (msgtype.getValue() == MsgType.LOGON)
                {
                    message.getHeader().setField(Username.FIELD, "wbaychidrop");
                    message.getHeader().setField(Password.FIELD, "W3aychi!");
                    //message.setField(RawData.FIELD, "W3aychi!");
                    //message.setField(RawDataLength.FIELD, "W3aychi!".Length.ToString());
                }

                //    SenderCompID sender = new SenderCompID();
                //    message.getHeader().getField(sender);

                //    if (sender.getValue().Equals("DHIRACH"))
                //    {
                //        message.getHeader().setField(SenderSubID.FIELD, "DHIRACH");
                //        message.getHeader().setField(TargetSubID.FIELD, "ITGD");
                //    }
                //    else
                //    {
                //        message.getHeader().setField(TargetSubID.FIELD, "DHIRACH");
                //        message.getHeader().setField(SenderSubID.FIELD, "ITGD");
                //    }
            }

            if (print)
            {
                Console.WriteLine("Logon Message: " + message.ToString());
            }
        }
Ejemplo n.º 3
0
        public void TCRMsgTypeGetsSetTest()
        {
            QuickFix.FIX44.TradeCaptureReport tcr = new QuickFix.FIX44.TradeCaptureReport();
            Assert.That(tcr.Header.IsSetField(QuickFix.Fields.Tags.MsgType), Is.True);
            MsgType msgType = new MsgType();

            tcr.Header.GetField(msgType);
            Assert.That(msgType.getValue(), Is.EqualTo("AE"));
        }
Ejemplo n.º 4
0
        public void fromAdmin(Message message, SessionID sessionId)
        {
            #region Documentation
            // notifies you when an administrative message is sent from a counterparty to your FIX engine. This can be
            // useful for doing extra validation on logon messages such as for checking passwords. Throwing a RejectLogon
            // exception will disconnect the counterparty.
            #endregion
            bool print = true;
            if (message.getHeader().isSetField(35))
            {
                MsgType msgtype = new MsgType();
                message.getHeader().getField(msgtype);
                if (msgtype.getValue() == "0" || msgtype.getValue() == "A")
                {
                    print = false;
                }
            }

            if (print)
            {
                Console.WriteLine("fromAdmin: " + message);
            }
        }
Ejemplo n.º 5
0
        public void TCRReqFieldsCTORTest()
        {
            QuickFix.FIX44.TradeCaptureReport tcr = new QuickFix.FIX44.TradeCaptureReport(
                new TradeReportID("dude1"),
                new PreviouslyReported(true),
                new Symbol("AAPL"),
                new LastQty(new Decimal(100.1)),
                new LastPx(new Decimal(100.2)),
                new TradeDate("2010-12-12"),
                new TransactTime(new DateTime(2010, 12, 15, 10, 55, 32, 455)));
            Assert.That(tcr.Symbol.getValue(), Is.EqualTo("AAPL"));
            Assert.That(tcr.TradeReportID.getValue(), Is.EqualTo("dude1"));
            MsgType msgType = new MsgType();

            tcr.Header.GetField(msgType);
            Assert.That(msgType.getValue(), Is.EqualTo("AE"));
        }