本文整理匯總了C#中QuickFix.Message.getField方法的典型用法代碼示例。如果您正苦於以下問題:C# Message.getField方法的具體用法?C# Message.getField怎麽用?C# Message.getField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類QuickFix.Message
的用法示例。
在下文中一共展示了Message.getField方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ReportExcuResult
//生成返回消息體
protected virtual void ReportExcuResult(string symbol, Message msg, SessionID sid)
{
try
{
var cs = msg.getField(ReportIndex);
var oid = msg.getField(ClientOrderIdIndex);
if (cs == "0") //queued
{
FixReport(msgTypeQueued, msg, ClientOrderIdIndex, string.Format(rspOrderStatus, Queued, symbol, 0, 0, oid));
unFill.ChangeStatus(oid, "Queued");
}
else if (cs == "8") // reject
{
var res = string.Format(rspOrderStatus, Reject, symbol, 0, 0, oid);
res += string.Format(rspError, msg.getField(TextIndex));
FixReport(msgTypeReject, msg, ClientOrderIdIndex, res);
unFill.ChangeStatus(oid, "Reject");
unFill.Remove(oid);
}
else if (cs == "4") // cancel
{
//目前4消息分兩種情況:撤單消息返回、市價單不成功或不完全成功。
//撤單消息返回時:有41,44字段。
//市價單不成功時:無41,44字段。
if (msg.isSetField(41) && msg.isSetField(44))
{
FixReport(msgTypeCancel, msg, ClientOrderIdIndex, string.Format(rspCancel, msg.getField(41)));
}
else
{
var res = string.Format(rspOrderStatus, Reject, symbol, 0, 0, oid);
res += string.Format(rspError, "MarketOrder is IOC/FOK(TimeInForce)");
FixReport(msgTypeReject, msg, ClientOrderIdIndex, res);
}
unFill.ChangeStatus(oid, "Canceled Or MarketOrderCanceled");
unFill.Remove(oid);
}
else if (cs == "1") //partiallyFilled
{
var price = msg.getField(PriceIndex);
var qty = (msg.getField(SideIndex) == SideSell ? "-" : "") + msg.getField(QtyIndex);
DefDealProc(symbol, price, qty, oid);
FixReport(msgTypePartFill, msg, ClientOrderIdIndex,
string.Format(rspOrderStatus, PartFill, symbol, price, qty, oid));
unFill.ChangeStatus(oid, "PartiallyFilled");
}
else if (cs == "2") //filled
{
var price = msg.getField(PriceIndex);
var qty = (msg.getField(SideIndex) == SideSell ? "-" : "") + msg.getField(QtyIndex);
DefDealProc(symbol, price, qty, oid);
FixReport(msgTypePartFill, msg, ClientOrderIdIndex,
string.Format(rspOrderStatus, FullFill, symbol, price, qty, oid));
unFill.ChangeStatus(oid, "Filled");
unFill.Remove(oid);
}
}
catch (Exception) { }
}
示例2: GetSymbol
protected string GetSymbol(Message msg)
{
try
{
return symbolList[msg.getField(ClientOrderIdIndex)];
}
catch (Exception){}
try
{
return msg.getField(SymbolIndex);
}
catch (Exception){}
return string.Empty;
}
示例3: MsgOrderCancelReject
//網關拒絕撤單
protected virtual void MsgOrderCancelReject(Message msg, SessionID sid)
{
try
{
FixReport(msgTypeCancel, msg, CancelClientOrderIdIndex,
string.Format(rspCancel, msg.getField(CancelClientOrderIdIndex))
+ string.Format(rspError, msg.getField(TextIndex)));
}
catch (Exception){}
}
示例4: FixReport
protected void FixReport(int type, Message msg, int IDfieldNum, string connect)
{
if (ReportCallBack != null)
{
try
{
ReportCallBack(type, msg.getField(IDfieldNum), connect);
}
catch (Exception)
{
ReportCallBack(type, string.Empty, connect);
}
}
}