平仓成交金额不是平仓名义本金

This commit is contained in:
吴方海
2025-06-13 16:44:44 +08:00
parent 663ead395c
commit e721f5ea5d
4 changed files with 8 additions and 6 deletions
@@ -850,7 +850,7 @@ namespace YLErp.Modules.SwapModule
unwindData.CloseMethod = unwindQty == unwindData.PositionQty ? (int)CloseMethodEnum. : (int)CloseMethodEnum.;
unwindData.ClosePercent = unwindData.PositionQty == 0 ? 0 : unwindPercent;
unwindData.CloseNotionalValue = position == null ? 0 : unwindQty * position.PosiGrossPrice * position.ContractSize;
unwindData.CloseNotionalValue = unwindPercent >= 1? unwindData.PosiNotionalValue: Math.Round(unwindData.CloseNotionalValue,2, MidpointRounding.AwayFromZero);
unwindData.CloseNotionalValue = unwindPercent >= 1? unwindData.PosiNotionalValue: Math.Round(unwindData.CloseNotionalValue, ConsGlobal.MoneyRound, MidpointRounding.AwayFromZero);
unwindData.CloseQty = unwindQty;
if (position != null)
{
@@ -882,8 +882,9 @@ namespace YLErp.Modules.SwapModule
floatEvent.TradingFee = closeFee;
floatEvent.MarkClosePnl = (unwindPrice - position.PosiGrossPrice) * unwindQty * floatRatio * longRatio;
floatEvent.MarkClosePnl = Math.Round(floatEvent.MarkClosePnl + ((floatEvent.TradingFeePending+ closeFee) * floatRatio * -1), ConsGlobal.MoneyRound, MidpointRounding.AwayFromZero);
floatEvent.TradingAmount = unwindData.CloseNotionalValue;
floatEvent.OptLog = "流水自动";
floatEvent.TradingAmount = unwindPrice * floatEvent.Quantity * floatEvent.ContractSize;
floatEvent.TradingAmount = Math.Round(floatEvent.TradingAmount, ConsGlobal.MoneyRound, MidpointRounding.AwayFromZero);
floatEvent.OptLog = "流水自动";
floatEvent.ClientId = td.ClientId;
floatEvent.SetOpt(UserInfo);
}
@@ -1294,7 +1294,8 @@ namespace YLErp.Modules.SwapModule
curretEod.PosiNetFeePrice = (eod.PosiNetFeePrice * eod.PosiQuantity + openFlowEvents.Sum(a => a.Quantity * a.TradingAmountNetFeeAvg)) / (eod.PosiQuantity + openQty);
curretEod.PosiNetFeePrice = Math.Round(curretEod.PosiNetFeePrice ?? 0, 10, MidpointRounding.AwayFromZero);
}
curretEod.PosiNotionalValue = eod.PosiNotionalValue+ openFlowEvents.Sum(s=>s.TradingAmount)- unwindFlowEvents.Sum(s=>s.TradingAmount);
curretEod.PosiNotionalValue = curretEod.PosiGrossPrice * curretEod.PosiQuantity * curretEod.ContractSize;
curretEod.PosiNotionalValue= Math.Round(curretEod.PosiNotionalValue, ConsGlobal.MoneyRound, MidpointRounding.AwayFromZero);
curretEod.TdPosiDividend = unwindEvents.Sum(x => x.DividendIn) * directionRatio;
curretEod.TdCloseFee = unwindEvents.Sum(x => x.TradingFee);
curretEod.TdCloseQty = unwindQty;