本文整理汇总了C#中QuickFix.ExecID类的典型用法代码示例。如果您正苦于以下问题:C# QuickFix.ExecID类的具体用法?C# QuickFix.ExecID怎么用?C# QuickFix.ExecID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QuickFix.ExecID类属于命名空间,在下文中一共展示了QuickFix.ExecID类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleExecReport
/// <summary>
/// Handle an incomming execution report
/// </summary>
/// <param name="myMsg"></param>
public void HandleExecReport(KaiTrade.Interfaces.Message myMsg)
{
try
{
if (m_Log.IsInfoEnabled)
{
m_Log.Info("OrderService:HandleExecReport:" + myMsg.Data);
}
if (m_ORLog.IsInfoEnabled)
{
m_ORLog.Info("OrderService:HandleExecReport:" + myMsg.Data);
}
// Get order manager
KaiTrade.Interfaces.OrderManager myOM = KTAFacade.Instance().Factory.GetOrderManager();
//Create a quickfix message object
QuickFix.Message myFixMsg = new QuickFix.Message(myMsg.Data);
QuickFix.ExecID myExecID = new QuickFix.ExecID();
myFixMsg.getField(myExecID);
// check if we have already processed this report
if (!myOM.RecordExecutionReport(myExecID.getValue(), myFixMsg))
{
// we have processed this already
m_Log.Warn("HandleExecReport: Duplicate Exec Report:" + myMsg.Data);
return;
}
// these fields must be present
QuickFix.OrderID myOrderID = new QuickFix.OrderID();
myFixMsg.getField(myOrderID);
QuickFix.ExecType myExecType = new QuickFix.ExecType();
myFixMsg.getField(myExecType);
QuickFix.OrdStatus myOrdStatus = new QuickFix.OrdStatus();
myFixMsg.getField(myOrdStatus);
// 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();
KaiTrade.Interfaces.Order myOrder = null;
if (myFixMsg.isSetField(myClOrdID))
{
myFixMsg.getField(myClOrdID);
myOrder = myOM.GetOrderWithClOrdIDID(myClOrdID.getValue());
}
if (myOrder == null)
{
myOrder = CreateSyntheticOrder(myFixMsg);
}
// add the ExecRep to the Order
KaiTrade.Interfaces.Fill myFill = new K2DataObjects.FillData();
myFill.OrderID = myOrder.Identity;
myFill.SetUpFromFixExecReport(myFixMsg.ToString());
myOrder.FillsList.Add(myFill);
// update mandatory fields
myOrder.OrderID = myOrderID;
myOrder.OrdStatus = myOrdStatus;
QuickFix.Text myText = new QuickFix.Text();
if (myFixMsg.isSetField(myText))
{
myFixMsg.getField(myText);
myOrder.Text = myText.getValue();
}
QuickFix.Account myAccount = new QuickFix.Account();
if (myFixMsg.isSetField(myAccount))
{
myFixMsg.getField(myAccount);
myOrder.Account = myAccount;
}
// process the execution depanding on type of ExecReport
switch (myExecType.getValue())
{
case QuickFix.ExecType.NEW:
processGeneralExecRep(ref myOrder, myFixMsg);
/*
if (order.LastOrderCommand == KaiTrade.Interfaces.LastOrderCommand.neworder)
{
order.LastOrderCommand = KaiTrade.Interfaces.LastOrderCommand.none;
}
else
{
m_Log.Error("HandleExecReport:OrderStatus new not expected");
}
* */
break;
case QuickFix.ExecType.FILL:
if (order.LastOrderCommand == KaiTrade.Interfaces.LastOrderCommand.neworder)
//.........这里部分代码省略.........
示例2: getExecID
public QuickFix.ExecID getExecID()
{ QuickFix.ExecID value = new QuickFix.ExecID();
getField(value); return value; }
示例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;
}