Exemplo n.º 1
0
 public static OrderAction c(QuickFix.Fields.Side s)
 {
     var val = s_sides.Find(v => v.first.getValue() == s.getValue());
     if (val == null)
         throw new Exception("Unmapped QuickFix.Fields.Side value : " + s.ToString());
     return val.second;
 }
Exemplo n.º 2
0
 public static OrderState c(QuickFix.Fields.OrdStatus s)
 {
     var val = s_ordState.Find(v => v.first.getValue() == s.getValue());
     if (val == null)
         throw new Exception("Unmapped QuickFix.Fields.OrdStatus value : " + s.ToString());
     return val.second;
 }
Exemplo n.º 3
0
 public void FromApp(QuickFix.Message msg, SessionID sessionID)
 {
     Console.WriteLine("FromApp - " + msg.ToString() + "@" + sessionID.ToString());
     try
     {
         Crack(msg, sessionID);
     }
     catch (Exception ex)
     {
         Console.WriteLine("==Cracker exception==");
         Console.WriteLine(ex.ToString());
         Console.WriteLine(ex.StackTrace);
     }
 }
Exemplo n.º 4
0
 public void ToApp(QuickFix.Message message, QuickFix.SessionID sessionId)
 {
     _strategy.ProcessToApp(message, QuickFix.Session.LookupSession(sessionId));
     Trace.WriteLine("## ToApp: " + message.ToString());
     if (MessageEvent != null)
         MessageEvent(message, false);
 }
Exemplo n.º 5
0
 public void OnCreate(QuickFix.SessionID sessionID)
 {
     Trace.WriteLine("## OnCreate: " + sessionID.ToString());
 }
Exemplo n.º 6
0
        /// <summary>
        /// ���ԶԶ˵�Ӧ�ò㱨�ģ���Ҫҵ���߼�����
        /// </summary>
        /// <param name="pMessage"></param>
        /// <param name="pSessionID"></param>
        public void fromApp(QuickFix.Message pMessage, QuickFix.SessionID pSessionID)
        {
            string msgtype = pMessage.getHeader ().getString  (35);

            if (msgtype.StartsWith("Ans"))
            {
                //Console.WriteLine(pMessage.ToString());
                 switch (msgtype)
                {
                     case "Ans003":
                         //string ccy=pMessage .getField (
                     case "Ans002":
                         if (OnError != null)
                         {
                             OnError(pMessage.ToString(), EventArgs.Empty);
                         }
                        break;
                }
            }
            else
            {
                base.crack(pMessage, pSessionID);//����Ĭ�ϴ����������
            }
            pMessage.Dispose();//�����ֳ�����Ҫ
        }
Exemplo n.º 7
0
        private void SendTheMessage(QuickFix.Message msg)
        {
            msg.Header.SetField(new QuickFix.Fields.TargetCompID(sessionID.SenderCompID));
            msg.Header.SetField(new QuickFix.Fields.SenderCompID(sessionID.TargetCompID));
            msg.Header.SetField(new QuickFix.Fields.MsgSeqNum(seqNum++));

            session.Next(msg.ToString());
        }
Exemplo n.º 8
0
 private void SendLogon(QuickFix.Message msg)
 {
     msg.Header.SetField(new QuickFix.Fields.TargetCompID(sessionID.SenderCompID));
     msg.Header.SetField(new QuickFix.Fields.SenderCompID(sessionID.TargetCompID));
     msg.Header.SetField(new QuickFix.Fields.MsgSeqNum(seqNum++));
     msg.Header.SetField(new QuickFix.Fields.SendingTime(System.DateTime.UtcNow));
     msg.SetField(new QuickFix.Fields.HeartBtInt(1));
     session.Next(msg.ToString());
 }
Exemplo n.º 9
0
 public void ToApp(QuickFix.Message msg, SessionID sessionID)
 {
     Console.WriteLine("ToApp - " + msg.ToString() + "@" + sessionID.ToString());
 }
Exemplo n.º 10
0
 public MessageRecord(QuickFix.Message msg, bool isIncoming)
 {
     MsgText = msg.ToString().Replace(QuickFix.Message.SOH, "|");
     Direction = isIncoming ? "IN" : "OUT";
     Timestamp = msg.Header.GetDateTime(QuickFix.Fields.Tags.SendingTime);
 }
Exemplo n.º 11
0
        /// <summary>
        /// Create a synthetic order
        /// </summary>
        /// <param name="myMsg"></param>
        /// <returns>n order</returns>
        public KaiTrade.Interfaces.Order CreateSyntheticOrder(QuickFix.Message myFixMsg)
        {
            KaiTrade.Interfaces.Order myOrder = null;
            try
            {
                if (m_Log.IsInfoEnabled)
                {
                    m_Log.Info("exec report recd:" + myFixMsg.ToString());
                }

                // Get order manager
                KaiTrade.Interfaces.OrderManager myOM = KTAFacade.Instance().Factory.GetOrderManager();

                // these fields must be present
                QuickFix.OrderID myOrderID = new QuickFix.OrderID();
                myFixMsg.getField(myOrderID);

                QuickFix.ExecType myExecType = new QuickFix.ExecType();
                myFixMsg.getField(myExecType);

                QuickFix.ExecID myExecID = new QuickFix.ExecID();
                myFixMsg.getField(myExecID);

                QuickFix.OrdStatus myOrdStatus = new QuickFix.OrdStatus();
                myFixMsg.getField(myOrdStatus);

                // Create the order
                myOrder = myOM.CreateOrder();

                // we need the clordid to update an existing order - if
                // it is not present or unknow we create a synthetic order
                QuickFix.ClOrdID myClOrdID = new QuickFix.ClOrdID();
                if (myFixMsg.isSetField(myClOrdID))
                {
                    myOrder.ClOrdID = myClOrdID;
                }
            }
            catch (Exception myE)
            {
                m_Log.Error("CreateSyntheticOrder", myE);
            }
            return myOrder;
        }
Exemplo n.º 12
0
		public void onMessage(QuickFix.FIX43.Reject message, SessionID session)
		{
			this.provider.EmitError(string.Format(BeAEwTZGlZaeOmY5cm.J00weU3cM6(676), (object)message.ToString()));
		}
Exemplo n.º 13
0
 public void FromApp(QuickFix.Message msg, QuickFix.SessionID sessionID)
 {
     m_logger.Info(sessionID.SenderCompID, " FromApp msg : " + msg.ToString());
     Crack(msg, sessionID);
 }
Exemplo n.º 14
0
 public void ToAdmin(QuickFix.Message msg, QuickFix.SessionID sessionID)
 {
     m_logger.Info(sessionID.SenderCompID," ToAdmin msg : " + msg.ToString());
     //Crack(msg, sessionID);
 }
Exemplo n.º 15
0
        public void FromAdmin(QuickFix.Message message, QuickFix.SessionID sessionID)
        {
            if (message.Header.GetString(35) == QuickFix.FIX42.Reject.MsgType)
                Console.WriteLine("REJECT RECEIVED: " + message.ToString());

            Trace.WriteLine("## FromAdmin: " + message.ToString());
            if (MessageEvent != null)
                MessageEvent(message, true);
        }
Exemplo n.º 16
0
 public void FromApp(QuickFix.Message message, QuickFix.SessionID sessionID)
 {
     Trace.WriteLine("## FromApp: " + message.ToString());
     if (MessageEvent != null)
         MessageEvent(message, true);
     Crack(message, sessionID);
 }
Exemplo n.º 17
0
 public void FromAdmin(QuickFix.Message msg, SessionID sessionID)
 {
     Console.WriteLine("FromAdmin - " + msg.ToString() + "@" + sessionID.ToString());
 }