本文整理匯總了C#中QuantConnect.Orders.OrderEvent.Clone方法的典型用法代碼示例。如果您正苦於以下問題:C# OrderEvent.Clone方法的具體用法?C# OrderEvent.Clone怎麽用?C# OrderEvent.Clone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類QuantConnect.Orders.OrderEvent
的用法示例。
在下文中一共展示了OrderEvent.Clone方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ProcessFill
/// <summary>
/// Processes a new fill, eventually creating new trades
/// </summary>
/// <param name="fill">The new fill order event</param>
/// <param name="conversionRate">The current market conversion rate into the account currency</param>
public void ProcessFill(OrderEvent fill, decimal conversionRate)
{
// If we have multiple fills per order, we assign the order fee only to its first fill
// to avoid counting the same order fee multiple times.
var orderFee = 0m;
if (!_ordersWithFeesAssigned.Contains(fill.OrderId))
{
orderFee = fill.OrderFee;
_ordersWithFeesAssigned.Add(fill.OrderId);
}
switch (_groupingMethod)
{
case FillGroupingMethod.FillToFill:
ProcessFillUsingFillToFill(fill.Clone(), orderFee, conversionRate);
break;
case FillGroupingMethod.FlatToFlat:
ProcessFillUsingFlatToFlat(fill.Clone(), orderFee, conversionRate);
break;
case FillGroupingMethod.FlatToReduced:
ProcessFillUsingFlatToReduced(fill.Clone(), orderFee, conversionRate);
break;
}
}