本文整理汇总了C#中QuickFix.IsSetPrice方法的典型用法代码示例。如果您正苦于以下问题:C# QuickFix.IsSetPrice方法的具体用法?C# QuickFix.IsSetPrice怎么用?C# QuickFix.IsSetPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuickFix
的用法示例。
在下文中一共展示了QuickFix.IsSetPrice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OrderRecord
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 = FIXApplication.FixEnumTranslator.Translate(nos.Side);
OrdType = FIXApplication.FixEnumTranslator.Translate(nos.OrdType);
Price = price;
Status = "New";
}
示例2: OrderRecord
public OrderRecord(QuickFix.FIX44.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 = Services.TranslateFixFields.Translate(nos.Side);
OrdType = Services.TranslateFixFields.Translate(nos.OrdType);
Price = price;
Quantity = nos.OrderQty.Obj;
Status = OrderStatus.New;
}
示例3: OnMessage
public void OnMessage(QuickFix.FIX42.OrderCancelReplaceRequest msg, QuickFix.SessionID session)
{
try
{
// qty set ?
int qty = -1;
if (msg.IsSetOrderQty()) qty = Convert.ToInt32(msg.OrderQty.getValue());
else if (msg.IsSetCashOrderQty()) qty = Convert.ToInt32(msg.CashOrderQty.getValue());
if (qty < 0)
{
RejectCancelRequest(session, msg.ClOrdID, msg.OrigClOrdID, null, "Qty nor CashOrderQty field is not set", QuickFix.Fields.CxlRejReason.BROKER_OPTION, true);
return;
}
double price = (msg.IsSetPrice() ? Convert.ToDouble(msg.Price.getValue()) : 0);
double stopPx = (msg.IsSetStopPx() ? Convert.ToDouble(msg.StopPx.getValue()) : 0);
ProcessOrderCancelRequest(session, msg.ClOrdID, msg.OrigClOrdID, true, qty, price, stopPx);
}
catch (Exception e)
{
RejectCancelRequest(session, msg.ClOrdID, msg.OrigClOrdID, null, "OnMessage(QuickFix.FIX42.OrderCancelReplaceRequest msg, QuickFix.SessionID session) : internal error : " + e.ToString()
, QuickFix.Fields.CxlRejReason.OTHER, true);
}
}