fix 平仓(InitUnwind L267)硬编码 1而不是剩余平仓比例
This commit is contained in:
@@ -264,7 +264,12 @@ namespace YLErp.Modules.SwapModule
|
||||
unwindData.PositionQty = position != null ? position.PosiQuantity : Convert.ToDecimal(td.TradeAmount);
|
||||
unwindData.AnnualDays = tradeExtend == null ? 365 : tradeExtend.ExtendObj.AnnualDays;
|
||||
unwindData.CloseMethod = (int)CloseMethodEnum.全部平仓;
|
||||
unwindData.ClosePercent = 1;
|
||||
// 占期初(original)语义(A):默认"平掉剩余全部持仓" = 剩余名义本金/期初名义本金。
|
||||
// 未平仓时 PosiNotionalValue==NotionalValue → 1(平100%);部分平仓后自动变为剩余比例(如已平10%则默认90%)。
|
||||
// 与互换/提前终止 InitIncome(L447) 保持一致。
|
||||
unwindData.ClosePercent = unwindData.NotionalValue > 0
|
||||
? unwindData.PosiNotionalValue / unwindData.NotionalValue
|
||||
: 1;
|
||||
unwindData.CloseNotionalValue = unwindData.PosiNotionalValue;
|
||||
unwindData.CloseQty = unwindData.PositionQty;
|
||||
if (position != null)
|
||||
|
||||
Reference in New Issue
Block a user