From 374182de623775cad6a883eb8e46a8b83efcd6b7 Mon Sep 17 00:00:00 2001 From: gongpei Date: Tue, 4 Nov 2025 14:31:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=9E=E6=97=B6=E6=8C=81=E4=BB=93?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=88=90=E4=BA=A4=E5=87=80=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/BLL/EodSettlement/RealtimePnlCalc.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/YLErpDAL/BLL/EodSettlement/RealtimePnlCalc.cs b/YLErpDAL/BLL/EodSettlement/RealtimePnlCalc.cs index 278819de..deebb2f8 100644 --- a/YLErpDAL/BLL/EodSettlement/RealtimePnlCalc.cs +++ b/YLErpDAL/BLL/EodSettlement/RealtimePnlCalc.cs @@ -571,12 +571,13 @@ namespace YLErp.BLL.Eod : s.PosiGrossPrice; return s.PosiQuantity * price; }) / posiQty; + // 使用标的期初价格不含费计算 var weightedNetPrice = posiQty == 0 ? 0 : positionGroupItems .Sum(s => { decimal price = ConsGlobal.InstrumentType.IsBond(lastPosi.UnderlyingInstrumentType) - ? s.PosiNetPrice * ConsGlobal.bondShowPriceMultiple - : s.PosiNetPrice; + ? s.PosiNetNoFeePrice ?? 0 * ConsGlobal.bondShowPriceMultiple + : s.PosiNetNoFeePrice ?? 0; return s.PosiQuantity * price; }) / posiQty; // 替换原代码中的 price 和 netPrice @@ -597,7 +598,7 @@ namespace YLErp.BLL.Eod } clientPosition.update_user = 0; SetClientPositionPrice(clientPosition); - clientPosition.swap_market_value = clientPosition.full_price_now * clientPosition.position_qty * (clientPosition.side == 0 ? 1 : -1); + clientPosition.swap_market_value = clientPosition.full_price_now * clientPosition.position_qty * (clientPosition.side == 0 ? 1 : -1) * 100; clientPosition.position_profit_loss = (clientPosition.full_price_now - clientPosition.deal_full_price_avg) * 0.01m * (clientPosition.position_qty * 10000) * (clientPosition.side == 0 ? 1 : -1) - clientPosition.commission; clientPosition.position_profit_loss = Math.Round(clientPosition.position_profit_loss ?? 0, 2, MidpointRounding.AwayFromZero); clientPosition.today_profit_loss = clientPosition.swap_market_value - lastPv;