当天利息端待实现逻辑修改为 = 上一天待实现 + 当天产生的利息 - flowEvents的利息

This commit is contained in:
锦麟 王
2026-07-01 15:20:24 +08:00
parent 47f95fcc45
commit fc90636ab4
@@ -830,11 +830,13 @@ namespace YLErp.Modules.SwapModule
newEodPayPosition.TdCloseInterest = flowEvents.Sum(x => x.InterestAmount);
newEodPayPosition.TdCloseInterestFee = newEodPayPosition.TdInterestFee;
//持仓内容-利息腿-损益统计(本方视角)
newEodPayPosition.TdInterestIncome = newEodPayPosition.TdCloseInterest;
// 互换日待实现应扣减当日实现的全程利息(TdCloseInterest)。
// 原公式 pre + TdInterestIncome - TdCloseInterest 中 TdInterestIncome==TdCloseInterest 会抵消,
// 导致待实现不变(互换结清后没归零)。改为直接 pre - TdCloseInterest。
newEodPayPosition.InterestIncomeSum = eodPayPosition.InterestIncomeSum - newEodPayPosition.TdCloseInterest;
var intersetAcmount = newEodPayPosition.TdInterestPrincipal * (newEodPayPosition.TdInterestRate + newEodPayPosition.FloatRate);
if (position.IsAnnualized)
{
intersetAcmount /= tradeExtend.AnnualDays;
}
newEodPayPosition.TdInterestIncome = intersetAcmount;// 要算一下当天产生的利息
newEodPayPosition.InterestIncomeSum = eodPayPosition.InterestIncomeSum + newEodPayPosition.TdInterestIncome - newEodPayPosition.TdCloseInterest; //上一天待实现 + 当天产生的利息 - flowEvents的利息
newEodPayPosition.InterestFeeSum = eodPayPosition.InterestFeeSum + newEodPayPosition.TdInterestFee - newEodPayPosition.TdCloseInterestFee;
newEodPayPosition.InterestProfitSum = newEodPayPosition.InterestIncomeSum + newEodPayPosition.InterestFeeSum;
//持仓价值