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;
 }
 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;
 }
Example #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);
     }
 }
Example #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);
 }
Example #5
0
 public void OnCreate(QuickFix.SessionID sessionID)
 {
     Trace.WriteLine("## OnCreate: " + sessionID.ToString());
 }
Example #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();//�����ֳ�����Ҫ
        }
Example #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());
        }
Example #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());
 }
Example #9
0
 public void ToApp(QuickFix.Message msg, SessionID sessionID)
 {
     Console.WriteLine("ToApp - " + msg.ToString() + "@" + sessionID.ToString());
 }
Example #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);
 }
Example #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;
        }
	public void onMessage(QuickFix.FIX43.Reject message, SessionID session)
	{
		this.provider.EmitError(string.Format(BeAEwTZGlZaeOmY5cm.J00weU3cM6(676), (object)message.ToString()));
	}
 public void FromApp(QuickFix.Message msg, QuickFix.SessionID sessionID)
 {
     m_logger.Info(sessionID.SenderCompID, " FromApp msg : " + msg.ToString());
     Crack(msg, sessionID);
 }
 public void ToAdmin(QuickFix.Message msg, QuickFix.SessionID sessionID)
 {
     m_logger.Info(sessionID.SenderCompID," ToAdmin msg : " + msg.ToString());
     //Crack(msg, sessionID);
 }
Example #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);
        }
Example #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);
 }
Example #17
0
 public void FromAdmin(QuickFix.Message msg, SessionID sessionID)
 {
     Console.WriteLine("FromAdmin - " + msg.ToString() + "@" + sessionID.ToString());
 }