refactor(accrual): 参数命名对齐业界标准(QuantLib/Strata)
FundingLegAccrual 4个方法的参数命名全面纠正: | 旧名 | 新名 | 理由 | |-------------------|-------------------|------| | originalPv | referenceNotional | Pv(现值)概念错误,实际是参考本金 | | closeRatio/closePercent | unwindFraction | 统一,对齐 ApplyUnwind.unwindPercent | | consumedInterest | realizedInterest | 对齐 AccrualState.RealizedInterest | | priorUnrealized | priorAccrued | 对齐 InterestResult.Accrued | | priorAccrualPrincipal | priorNotional | 简洁,对齐 QuantLib notional | | positionPrincipal | notional | 简化,去掉冗余前缀 | | dynomicPrincipal | accrualBasis | 修正typo+用业界术语 | 同步更新: - SwapDealService.CalcDailySimpleInterestByEod 调用点 - 3个影子测试文件命名参数 - SwapInterest.Round 改为 public(所有Round收口一处) 删除半成品残留: SwapInterest_CompoundInArrears_RolloverTimingTests.cs 验证: 编译0错误, 7个影子测试全过, 全量520测试7失败(基线一致)。
This commit is contained in:
@@ -87,7 +87,7 @@ namespace UnitTestProject.Modules.SwapModule.Accrual
|
||||
(StartDate.AddDays(14), allInRate),
|
||||
};
|
||||
var result = FundingLegAccrual.AccrueCompoundPeriod(
|
||||
principal: Notional,
|
||||
notional: Notional,
|
||||
segmentRates: segRates,
|
||||
startDate: StartDate,
|
||||
endDate: EndDate,
|
||||
@@ -129,7 +129,7 @@ namespace UnitTestProject.Modules.SwapModule.Accrual
|
||||
(StartDate.AddDays(14), allInRate),
|
||||
};
|
||||
var result = FundingLegAccrual.AccrueCompoundPeriod(
|
||||
principal: Notional * closePct,
|
||||
notional: Notional * closePct,
|
||||
segmentRates: segRates,
|
||||
startDate: StartDate,
|
||||
endDate: EndDate,
|
||||
@@ -137,8 +137,8 @@ namespace UnitTestProject.Modules.SwapModule.Accrual
|
||||
annualDays: AnnualDays,
|
||||
isAnnualized: true,
|
||||
resetCarryInterest: carry,
|
||||
consumedInterest: consumed,
|
||||
closePercent: closePct);
|
||||
realizedInterest: consumed,
|
||||
unwindFraction: closePct);
|
||||
|
||||
Console.WriteLine($"旧: I={oldI} Td={oldTd}");
|
||||
Console.WriteLine($"新: Accrued={result.Accrued} AccruedToday={result.AccruedToday}");
|
||||
@@ -171,7 +171,7 @@ namespace UnitTestProject.Modules.SwapModule.Accrual
|
||||
(StartDate.AddDays(14), allInRate),
|
||||
};
|
||||
var result = FundingLegAccrual.AccrueCompoundPeriod(
|
||||
principal: Notional,
|
||||
notional: Notional,
|
||||
segmentRates: segRates,
|
||||
startDate: StartDate,
|
||||
endDate: EndDate,
|
||||
|
||||
Reference in New Issue
Block a user