本文整理汇总了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;
}
示例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);
}
示例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);
}
}