本文整理汇总了C#中StockSharp.Messages.ExecutionMessage.SetWhyHeld方法的典型用法代码示例。如果您正苦于以下问题:C# ExecutionMessage.SetWhyHeld方法的具体用法?C# ExecutionMessage.SetWhyHeld怎么用?C# ExecutionMessage.SetWhyHeld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StockSharp.Messages.ExecutionMessage
的用法示例。
在下文中一共展示了ExecutionMessage.SetWhyHeld方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadOrderStatus
private void ReadOrderStatus(IBSocket socket, ServerVersions version)
{
var id = socket.ReadInt();
var status = socket.ReadOrderStatus();
/* filled */
socket.ReadInt();
var balance = socket.ReadDecimal();
var avgPrice = socket.ReadDecimal();
var permId = version >= ServerVersions.V2 ? socket.ReadInt() : (int?)null;
var parentId = version >= ServerVersions.V3 ? socket.ReadInt() : (int?)null;
var lastTradePrice = version >= ServerVersions.V4 ? socket.ReadDecimal() : (decimal?)null;
var clientId = version >= ServerVersions.V5 ? socket.ReadInt() : (int?)null;
var whyHeld = version >= ServerVersions.V6 ? socket.ReadStr() : null;
var execMsg = new ExecutionMessage
{
ExecutionType = ExecutionTypes.Transaction,
OriginalTransactionId = id,
Balance = balance,
OrderStatus = status,
OrderState = status.ToOrderState(),
HasOrderInfo = true,
};
execMsg.SetAveragePrice(avgPrice);
if (permId != null)
execMsg.SetPermId(permId.Value);
if (parentId != null)
execMsg.Condition = new IBOrderCondition { ParentId = parentId.Value };
if (lastTradePrice != null)
execMsg.SetLastTradePrice(lastTradePrice.Value);
if (clientId != null)
execMsg.SetClientId(clientId.Value);
if (whyHeld != null)
execMsg.SetWhyHeld(whyHeld);
SendOutMessage(execMsg);
}