public void HandleExecutionReport(QuickFix.FIX44.ExecutionReport msg)
        {
            try
            {
                string execId = msg.ExecID.Obj;
                //string transType = FixEnumTranslator.Translate(msg.ExecType);
                string execType = FixEnumTranslator.Translate(msg.ExecType);

                Trace.WriteLine("EVM: Handling ExecutionReport: " + execId + " / " + execType);

                ExecutionRecord exRec = new ExecutionRecord(
                    msg.ExecID.Obj,
                    msg.OrderID.Obj,
                    string.Empty,
                    execType,
                    msg.Symbol.Obj,
                    FixEnumTranslator.Translate(msg.Side));

                exRec.LeavesQty      = msg.LeavesQty.getValue();
                exRec.TotalFilledQty = msg.CumQty.getValue();
                exRec.LastQty        = msg.LastQty.getValue();

                SmartDispatcher.Invoke(new Action <ExecutionRecord>(AddExecution), exRec);
            }
            catch (Exception e)
            {
                Trace.WriteLine(e.ToString());
            }
        }
Beispiel #2
0
        public OrderRecord(QuickFix.FIX42.NewOrderSingle nos)
        {
            OriginalNOS = nos;

            decimal price = -1;

            if (nos.OrdType.Obj == QuickFix.Fields.OrdType.LIMIT && nos.IsSetPrice())
            {
                price = nos.Price.Obj;
            }

            ClOrdID = nos.ClOrdID.Obj;
            Symbol  = nos.Symbol.Obj;
            Side    = FixEnumTranslator.Translate(nos.Side);
            OrdType = FixEnumTranslator.Translate(nos.OrdType);
            Price   = price;
            Status  = "New";

            if (nos.IsSetField(167))
            {
                SecurityType = FixEnumTranslator.Translate(nos.SecurityType);
            }

            if (nos.IsSetField(201))
            {
                CallOrPut = FixEnumTranslator.Translate(nos.PutOrCall);
            }

            if (nos.IsSetField(202))
            {
                Strike = nos.StrikePrice.Obj;
            }
        }
Beispiel #3
0
        public void HandleExecutionReport(QuickFix.FIX42.ExecutionReport msg)
        {
            try
            {
                string execId    = msg.ExecID.Obj;
                string transType = FixEnumTranslator.Translate(msg.ExecTransType);
                string execType  = FixEnumTranslator.Translate(msg.ExecType);

                Trace.WriteLine("EVM: Handling ExecutionReport: " + execId + " / " + transType + " / " + execType);

                ExecutionRecord exRec = new ExecutionRecord(
                    msg.ExecID.Obj,
                    msg.OrderID.Obj,
                    transType,
                    execType,
                    msg.Symbol.Obj,
                    FixEnumTranslator.Translate(msg.Side));

                SmartDispatcher.Invoke(new Action <ExecutionRecord>(AddExecution), exRec);
            }
            catch (Exception e)
            {
                Trace.WriteLine(e.ToString());
            }
        }
Beispiel #4
0
        public void HandleExecutionReport(QuickFix.FIX42.ExecutionReport msg)
        {
            try
            {
                string execId    = msg.ExecID.Obj;
                string transType = FixEnumTranslator.Translate(msg.ExecTransType);
                string execType  = FixEnumTranslator.Translate(msg.ExecType);

                Trace.WriteLine("EVM: Handling ExecutionReport: " + execId + " / " + transType + " / " + execType);

                String securityType = "";
                if (msg.IsSetField(167))
                {
                    securityType = FixEnumTranslator.Translate(msg.SecurityType);
                }

                String putOrCall = "";
                if (msg.IsSetField(201))
                {
                    putOrCall = FixEnumTranslator.Translate(msg.PutOrCall);
                }

                decimal strikePrice = 0;
                if (msg.IsSetField(202))
                {
                    strikePrice = msg.StrikePrice.Obj;
                }

                ExecutionRecord exRec = new ExecutionRecord(
                    msg.ExecID.Obj,
                    msg.OrderID.Obj,
                    transType,
                    execType,
                    msg.Symbol.Obj,
                    FixEnumTranslator.Translate(msg.Side),
                    securityType,
                    putOrCall,
                    strikePrice);

                SmartDispatcher.Invoke(new Action <ExecutionRecord>(AddExecution), exRec);
            }
            catch (Exception e)
            {
                Trace.WriteLine(e.ToString());
            }
        }
        public void HandleExecutionReport(QuickFix.FIX42.ExecutionReport msg)
        {
            try
            {
                if (msg.IsSetField(11) && msg.ClOrdID != null)
                {
                    string clOrdId = msg.ClOrdID.Obj;


                    string status = FixEnumTranslator.Translate(msg.OrdStatus);

                    //Trace.WriteLine("OVM: Handling ExecutionReport: " + clOrdId + " / " + status);

                    lock (_ordersLock)
                    {
                        foreach (OrderRecord r in Orders)
                        {
                            if (r.ClOrdID == clOrdId)
                            {
                                r.Status = status;
                                if (msg.IsSetLastPx())
                                {
                                    r.Price = msg.LastPx.Obj;
                                }
                                if (msg.IsSetOrderID())
                                {
                                    r.OrderID = msg.OrderID.Obj;
                                }

                                return;
                            }
                        }
                    }

                    //Trace.WriteLine("OVM: No order corresponds to ClOrdID '" + clOrdId + "'");
                }
            }
            catch (Exception e)
            {
                Trace.WriteLine(e.ToString());
            }
        }
        public void HandleExecutionReport(QuickFix.FIX44.ExecutionReport msg)
        {
            try
            {
                string clOrdId = msg.ClOrdID.Obj;
                string status  = FixEnumTranslator.Translate(msg.OrdStatus);

                Trace.WriteLine("OVM: Handling ExecutionReport: " + clOrdId + " / " + status);

                lock (_ordersLock)
                {
                    foreach (OrderRecord r in Orders)
                    {
                        if (r.ClOrdID == clOrdId)
                        {
                            r.Status = status;
                            if (msg.IsSetLastPx())
                            {
                                r.Price = msg.LastPx.Obj;
                            }
                            if (msg.IsSetOrderID())
                            {
                                r.OrderID = msg.OrderID.Obj;
                            }

                            r.LeavesQty      = msg.LeavesQty.getValue();
                            r.TotalFilledQty = msg.CumQty.getValue();
                            r.LastQty        = msg.LastQty.getValue();

                            return;
                        }
                    }
                }

                Trace.WriteLine("OVM: No order corresponds to ClOrdID '" + clOrdId + "'");
            }
            catch (Exception e)
            {
                Trace.WriteLine(e.ToString());
            }
        }