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


C# QuickFix.getValue方法代码示例

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


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

示例1: c

 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;
 }
开发者ID:redrhino,项目名称:NinjaTrader_FixBridge,代码行数:7,代码来源:Converter.cs

示例2: RejectCancelRequest

        protected void RejectCancelRequest(QuickFix.SessionID session, QuickFix.Fields.ClOrdID clordid, QuickFix.Fields.OrigClOrdID origordid, IOrder nt7_order, string rej_reason, int cxl_rej, bool is_cancelreplace_request)
        {
            QuickFix.FIX42.OrderCancelReject rej = new QuickFix.FIX42.OrderCancelReject();
            if (nt7_order == null)
                rej.Set(new QuickFix.Fields.OrderID("NONE"));
            else
                rej.Set(new QuickFix.Fields.OrderID(clordid.getValue()));

            rej.Set(origordid);
            rej.Set(Converter.c(nt7_order.OrderState));
            rej.Set(new QuickFix.Fields.CxlRejResponseTo(is_cancelreplace_request ? QuickFix.Fields.CxlRejResponseTo.ORDER_CANCEL_REPLACE_REQUEST : QuickFix.Fields.CxlRejResponseTo.ORDER_CANCEL_REQUEST));
            rej.Set(new QuickFix.Fields.CxlRejReason(cxl_rej));
            rej.Set(new QuickFix.Fields.Text(rej_reason));
            rej.Set(new QuickFix.Fields.TransactTime(DateTime.Now, true));

            QuickFix.Session.SendToTarget(rej, session);
        }
开发者ID:redrhino,项目名称:NinjaTrader_FixBridge,代码行数:17,代码来源:QuickFixApp.cs

示例3: ProcessOrderCancelRequest

        protected void ProcessOrderCancelRequest(QuickFix.SessionID session, QuickFix.Fields.ClOrdID clordid, QuickFix.Fields.OrigClOrdID origordid
            , bool is_cancelreplace_request, int new_qty, double new_px, double new_stop_px)
        {
            IOrder order = null;
            try
            {
                // order exists ?
                OrderFixBridge order_bridge ;
                lock(locker_)
                    order_bridge = m_orders.AddOrGet(null, origordid.getValue(), session);

                if (order_bridge.Order == null)
                {
                    RejectCancelRequest(session, clordid, origordid, null, "Unknown order !", QuickFix.Fields.CxlRejReason.UNKNOWN_ORDER, true);
                    return;
                }

                order = order_bridge.Order;

                switch (order.OrderState)
                {
                    // order is still alive, go ahead
                    case OrderState.Accepted:
                    case OrderState.PartFilled:
                    case OrderState.Working:
                        if (is_cancelreplace_request)
                            QuickFixStaticAcceptor.FromFIX_ChangeOrder(order, new_qty, new_px, new_stop_px);
                        else
                            QuickFixStaticAcceptor.FromFIX_CancelOrder(order);

                        return;

                    // pending
                    case OrderState.PendingChange: //VV?
                    case OrderState.PendingSubmit: //VV?
                    case OrderState.PendingCancel: //VV?
                        {
                            string error_message = "Invalid cancel or cancel/replace request since order " + origordid.getValue() + " is in pending state : " + order.OrderState.ToString();
                            RejectCancelRequest(session, clordid, origordid, order, error_message, QuickFix.Fields.CxlRejReason.ALREADY_PENDING, is_cancelreplace_request);
                            return;
                        }

                    // terminal state
                    case OrderState.Cancelled:
                    case OrderState.Filled:
                    case OrderState.Rejected:
                        {
                            string error_message = "Invalid cancel or cancel/replace request since order " + origordid.getValue() + " is in terminal/closed state : " + order.OrderState.ToString();
                            RejectCancelRequest(session, clordid, origordid, order, error_message, QuickFix.Fields.CxlRejReason.TOO_LATE_TO_CANCEL, is_cancelreplace_request);
                            return;
                        }
                    case OrderState.Unknown:
                        {
                            string error_message = "Invalid cancel or cancel/replace request since order " + origordid.getValue() + " is in unknow NT7 state : " + order.OrderState.ToString();
                            RejectCancelRequest(session, clordid, origordid, order, error_message, QuickFix.Fields.CxlRejReason.OTHER, is_cancelreplace_request);
                            return;
                        }
                }
            }
            catch (Exception e)
            {
                RejectCancelRequest(session, clordid, origordid, order, "ProcessOrderCancelRequest : internal Error : " + e.ToString()
                , QuickFix.Fields.CxlRejReason.OTHER, is_cancelreplace_request);
            }
        }
开发者ID:redrhino,项目名称:NinjaTrader_FixBridge,代码行数:65,代码来源:QuickFixApp.cs


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