internal ValuationCostIncomeMutation(ValuationKey key, DateTime mutationDate, ValuationCostIncomeMutation prevMutation) : this(key, mutationDate) { if (prevMutation != null) { this.CostsCommissionToDate = prevMutation.CostsCommissionToDate; this.CostsTaxToDate = prevMutation.CostsTaxToDate; this.CostsOtherToDate = prevMutation.CostsOtherToDate; this.IncomeCashDividendToDate = prevMutation.IncomeCashDividendToDate; this.IncomeInterestToDate = prevMutation.IncomeInterestToDate; this.IncomeOtherToDate = prevMutation.IncomeOtherToDate; } }
internal void AddCash(IPositionTx posTx) { DateTime tradeDate = posTx.TransactionDate; ValuationCostIncomeMutation mutation; if (mutationsCI.ContainsKey(tradeDate)) mutation = mutationsCI[tradeDate]; else { mutation = new ValuationCostIncomeMutation(this, tradeDate, LastMutationCI); if (mutationsCI.Count == 0) FirstMutationCI = mutation; mutationsCI.Add(tradeDate, mutation); LastMutationCI = mutation; } mutation.AddTx(posTx); }