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

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
@@ -68,7 +68,7 @@ namespace YLErp.Plugins.ShanXi.DocumentGenerator
row.ClosePrice = ((flowEventGroup.TradingAmountAvg) * 100).ToString("0.00000000");
decimal interestRate = unwindFlowEvents.Where(x => ConsTrade.InterestModels.Contains(x.InterestMode)).Sum(s => s.InterestRate);
row.InterestRate = interestRate.ToString("0.00%");
var PosiNotionalValue = flowEventGroup.TradingAmount;
var PosiNotionalValue = flowEventGroup.Quantity * flowEventGroup.ContractSize* posi.PosiGrossPrice;
row.Quantity= flowEventGroup.Quantity.ToString("0.00");
row.PosiNotionalValue = PosiNotionalValue.ToString("0.00");
row.PosiNetPrice = (posi.PosiGrossPrice * 100).ToString("0.00000000");
@@ -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;
@@ -222,7 +222,7 @@ const vue = new Vue({
thisObj.deal.SwapRealizedPnL = pnl;
thisObj.deal.SwapMarginRebatePnl = 0;
thisObj.deal.SwapMarginAmount = 0;
thisObj.floatPosition.TradingAmount = parseFloat(thisObj.deal.CloseNotionalValue);
thisObj.floatPosition.TradingAmount = parseFloat(thisObj.floatPosition.TradingAmountAvg) * parseFloat(thisObj.deal.CloseQty) * 0.01;
thisObj.floatPosition.CloseFee = TradingFee;
if (thisObj.deal.CloseQty == 0) {
thisObj.floatPosition.TradingAmountFeeAvg = 0;