当前位置: 首页>>代码示例>>C#>>正文


C# QuickFix.isSetField方法代码示例

本文整理汇总了C#中QuickFix.isSetField方法的典型用法代码示例。如果您正苦于以下问题:C# QuickFix.isSetField方法的具体用法?C# QuickFix.isSetField怎么用?C# QuickFix.isSetField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QuickFix的用法示例。


在下文中一共展示了QuickFix.isSetField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: toAdmin

 /// <summary>
 /// ���͸��Զ˵ĻỰ�㱨�ģ�ͨ��CONSOLE�����
 /// </summary>
 /// <param name="message"></param>
 /// <param name="pSessionID"></param>
 public void toAdmin(QuickFix.Message message, QuickFix.SessionID pSessionID)
 {
     if (message is QuickFix42 .Logon )//ȷ���ǵ�½����
     {
         string rawdata = option .Rawdata ;
         message.setString(96, rawdata);
     }
     else if (message is QuickFix42.Logout)
     {
         if (message.isSetField(58))
         {
             string note = message.getString(58);
             if (OnError != null)
             {
                 OnError(note, EventArgs.Empty);
             }
         }
     }
     //Console.WriteLine("Enter toAdmin");
     //Console.WriteLine(message.ToString());
     //Console.WriteLine("Exit toAdmin");
       //  MessageBox.Show("toAdmin"+message .ToString ());  //20091229
 }
开发者ID:niuwadavid,项目名称:gsfix4net,代码行数:28,代码来源:QuickFixWrapper.cs

示例2: processGeneralExecRep

        /// <summary>
        /// Process general purpose exec i.e. some type of order status change
        /// </summary>
        /// <param name="myOrder"></param>
        /// <param name="myExec"></param>
        private void processGeneralExecRep(ref KaiTrade.Interfaces.Order myOrder, QuickFix.Message myExec)
        {
            if (m_ORLog.IsInfoEnabled)
            {
                m_ORLog.Info("processGeneralExecRep:");
            }
            QuickFix.OrdStatus myOrdStatus = new QuickFix.OrdStatus();
            QuickFix.LeavesQty myLeavesQty = new QuickFix.LeavesQty();
            QuickFix.CumQty myCumQty = new QuickFix.CumQty();
            myExec.getField(myOrdStatus);
            myOrder.OrdStatus = myOrdStatus;

            switch (myOrdStatus.getValue())
            {
                case QuickFix.OrdStatus.CANCELED:
                    if (order.LastOrderCommand == KaiTrade.Interfaces.LastOrderCommand.cancel)
                    {
                        order.LastOrderCommand = KaiTrade.Interfaces.LastOrderCommand.none;
                    }

                    myLeavesQty = new QuickFix.LeavesQty(0.0);
                    myOrder.LeavesQty = myLeavesQty;
                    break;
                case QuickFix.OrdStatus.NEW:

                    if (order.LastOrderCommand == KaiTrade.Interfaces.LastOrderCommand.neworder)
                    {
                        order.LastOrderCommand = KaiTrade.Interfaces.LastOrderCommand.none;
                    }
                    else if (order.LastOrderCommand == KaiTrade.Interfaces.LastOrderCommand.replace)
                    {
                        order.LastOrderCommand = KaiTrade.Interfaces.LastOrderCommand.none;
                    }
                    else
                    {
                        m_Log.Error("HandleExecReport:OrderStatus new not expected");
                    }
                    myOrder.LeavesQty  = new QuickFix.LeavesQty(myOrder.OrderQty.getValue());
                    myOrder.CumQty = new QuickFix.CumQty(0.0);
                    break;
                case QuickFix.OrdStatus.REPLACED:
                    if (order.LastOrderCommand == KaiTrade.Interfaces.LastOrderCommand.replace)
                    {
                        order.LastOrderCommand = KaiTrade.Interfaces.LastOrderCommand.none;
                    }
                    if (myExec.isSetField(myLeavesQty))
                    {
                        myExec.getField(myLeavesQty);
                        myOrder.LeavesQty = myLeavesQty;
                    }
                    if (myExec.isSetField(myCumQty))
                    {
                        myExec.getField(myCumQty);
                        myOrder.CumQty = myCumQty;
                    }

                    break;
                case QuickFix.OrdStatus.PENDING_REPLACE:
                    if (order.LastOrderCommand == KaiTrade.Interfaces.LastOrderCommand.replace)
                    {
                        m_ORLog.Error("Pending replace received but last command is not replace");
                    }

                    break;
                case QuickFix.OrdStatus.REJECTED:
                    if (order.LastOrderCommand == KaiTrade.Interfaces.LastOrderCommand.cancel)
                    {
                        order.LastOrderCommand = KaiTrade.Interfaces.LastOrderCommand.none;
                    }
                    else if (order.LastOrderCommand == KaiTrade.Interfaces.LastOrderCommand.neworder)
                    {
                        order.LastOrderCommand = KaiTrade.Interfaces.LastOrderCommand.none;
                    }
                    else if (order.LastOrderCommand == KaiTrade.Interfaces.LastOrderCommand.replace)
                    {
                        order.LastOrderCommand = KaiTrade.Interfaces.LastOrderCommand.none;
                    }
                    break;
                default:
                    break;
            }
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:87,代码来源:OrderService.cs

示例3: CreateSyntheticOrder

        /// <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;
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:48,代码来源:OrderService.cs

示例4: processFill

        /// <summary>
        /// Process partial or fully filled
        /// </summary>
        /// <param name="myOrder"></param>
        /// <param name="myExec"></param>
        private void processFill(ref KaiTrade.Interfaces.Order myOrder, QuickFix.Message myExec)
        {
            K2ServiceInterface.ITransaction myTrn = null;
            try
            {
                // if the object supports transactions do the update as a trn
                myTrn = myOrder as K2ServiceInterface.ITransaction;
                if (myTrn != null)
                {
                    myTrn.StartUpdate();
                }
                // Get the currently executed quantity for chain of orders.
                QuickFix.CumQty myCumQty = new QuickFix.CumQty();
                myExec.getField(myCumQty);
                myOrder.CumQty = myCumQty;

                // Get quantity open for further execution (order qty - cum qty)
                QuickFix.LeavesQty myLeavesQty = new QuickFix.LeavesQty();
                myExec.getField(myLeavesQty);
                myOrder.LeavesQty = myLeavesQty;

                QuickFix.LastPx myLastPx = new QuickFix.LastPx();
                if (myExec.isSetField(myLastPx))
                {
                    myExec.getField(myLastPx);
                    myOrder.LastPx = myLastPx;
                }

                QuickFix.AvgPx myAvgPx = new QuickFix.AvgPx();
                if (myExec.isSetField(myAvgPx))
                {
                    myExec.getField(myAvgPx);
                    myOrder.AvgPx = myAvgPx;
                }

                QuickFix.LastQty myLastQty = new QuickFix.LastQty();
                if (myExec.isSetField(myLastQty))
                {
                    myExec.getField(myLastQty);
                    myOrder.LastQty = myLastQty;
                }

                QuickFix.OrdStatus myOrdStatus = new QuickFix.OrdStatus();
                myExec.getField(myOrdStatus);
                myOrder.OrdStatus = myOrdStatus;
                // always signal the end of the update
                if (myTrn != null)
                {
                    myTrn.EndUpdate();
                }
            }
            catch (Exception myE)
            {
                m_Log.Error("processFill", myE);
                // always signal the end of the update
                if (myTrn != null)
                {
                    myTrn.EndUpdate();
                }
            }
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:66,代码来源:OrderService.cs


注:本文中的QuickFix.isSetField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。