public void Clear() { Profits.Clear(); BuyQuantities.Clear(); TradeLog.Clear(); _tradingResultsRepository.Clear(); }
public void EvaluateCostsAndProfits() { if (!Totals.Any()) // Totals need to be evaluated beforehand { EvaluateTotals(); } Costs.Clear(); Profits.Clear(); for (var index = 0; index <= _diffMonths; index++) { var period = _from.AddMonths(index); var ordersInMonth = _orders.Where(IsInMonth(period.Month)); Costs.Add(ordersInMonth.Sum(order => order.OrderTotalCost)); Profits.Add(Totals[index] - Costs[index]); } }