Ejemplo n.º 1
0
        public static string Translate(QuickFix.Fields.ExecTransType execTransType)
        {
            switch (execTransType.Obj)
            {
            case QuickFix.Fields.ExecTransType.CANCEL: return("Cancel");

            case QuickFix.Fields.ExecTransType.CORRECT: return("Correct");

            case QuickFix.Fields.ExecTransType.NEW: return("New");

            case QuickFix.Fields.ExecTransType.STATUS: return("Status");
            }
            return("unknown");
        }
Ejemplo n.º 2
0
 public void Set(QuickFix.Fields.ExecTransType val)
 {
     this.ExecTransType = val;
 }
        //receive fills, working orders, order rejects
        public void OnMessage(QuickFix.FIX42.ExecutionReport message, QuickFix.SessionID session)
        {
            //parseMessage(message, session);
            try
            {
                QuickFix.Fields.ExecType et = new QuickFix.Fields.ExecType();
                QuickFix.Fields.ExecTransType ett = new QuickFix.Fields.ExecTransType();
                QuickFix.Fields.ClOrdID coid = new QuickFix.Fields.ClOrdID();

                //Friday, December 11, 2009 10:29:27 AM Added parentheses to encapsulate OR
                //remove hold on orders if order was rejected
                if (message.IsSetField(coid) &&
                    (message.GetField(et).getValue() == QuickFix.Fields.ExecType.FILL ||
                    message.GetField(et).getValue() == QuickFix.Fields.ExecType.REJECTED))
                {
                    updateOrderMgmt(message.GetField(coid).getValue().ToString());
                }
                //end modified code

                if (message.IsSetField(et))
                {
                    //capture fill to update position
                    if ((message.GetField(et).getValue() == QuickFix.Fields.ExecType.FILL ||
                         message.GetField(et).getValue() == QuickFix.Fields.ExecType.PARTIAL_FILL) &&
                         message.MultiLegReportingType.getValue() != QuickFix.Fields.MultiLegReportingType.MULTI_LEG_SECURITY)
                    {
                        updateDisplay("execution received");
                        posTableUpdate(message, session);

                    }

                    //capture working orders and cancel for flatten
                    if (message.GetField(et).getValue() == QuickFix.Fields.ExecType.RESTATED &&
                        message.GetField(ett).getValue() == QuickFix.Fields.ExecTransType.STATUS)
                    {

                        string MGT = null;
                        QuickFix.Fields.SenderSubID subID = new QuickFix.Fields.SenderSubID();
                        if (message.Header.IsSetField(subID))
                        {
                            MGT = message.Header.GetField(subID).ToString();
                            orderCancel(MGT, message.OrderID.ToString());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                updateDisplay("QuickFIX Error");
                log.WriteLog(ex.ToString());

            }
        }