private double ComputeExecutionQuantity(Side side) { return(EventLogs.OfType <OrderParameterEventLog <OrderDealingEventParameter> >() .Select(e => e.Parameters.Trade) .Where(t => t.TradeState != TradeState.Cancelled) .Sum(t => t.Side == side ? t.ExecutionQuantity : -t.ExecutionQuantity)); }