本文整理匯總了C#中StockSharp.Messages.ExecutionMessage.SetLastTradePrice方法的典型用法代碼示例。如果您正苦於以下問題:C# ExecutionMessage.SetLastTradePrice方法的具體用法?C# ExecutionMessage.SetLastTradePrice怎麽用?C# ExecutionMessage.SetLastTradePrice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類StockSharp.Messages.ExecutionMessage
的用法示例。
在下文中一共展示了ExecutionMessage.SetLastTradePrice方法的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);
}