From 3fb50ad1e73c76de9ad3453e9a85e6df9c38dbfb Mon Sep 17 00:00:00 2001 From: shangzhongyuan Date: Tue, 5 Aug 2025 17:39:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E5=86=B2=E4=BA=A4=E6=98=93=20?= =?UTF-8?q?=E6=8C=81=E4=BB=93=E5=90=8D=E4=B9=89=E6=9C=AC=E9=87=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YLErpDAL/Modules/CalculationModule/HedgePnlCalc.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/YLErpDAL/Modules/CalculationModule/HedgePnlCalc.cs b/YLErpDAL/Modules/CalculationModule/HedgePnlCalc.cs index f6280fd0..c09ad06a 100644 --- a/YLErpDAL/Modules/CalculationModule/HedgePnlCalc.cs +++ b/YLErpDAL/Modules/CalculationModule/HedgePnlCalc.cs @@ -264,7 +264,7 @@ namespace YLErp.Modules.CalculationModule newPnl.RealizedPnL += closeProfit; //减去持仓成本 - newPnl.Cost -= openAmount; + newPnl.Cost += closeAmount; //减去持仓份额 newPnl.Notional -= closeNotional * posSign; @@ -483,6 +483,11 @@ namespace YLErp.Modules.CalculationModule /// public static string GetHedgeUniqueCode(int BookId, string TradeType, string LongShort, string UnderlyingCode, string ExchangeOptionCode = null) { + List tradeTypes=new List() { "利率债", "信用债", "其它债券" }; + if (tradeTypes.Contains(TradeType)) + { + return $"{BookId}_{TradeType}_{UnderlyingCode}".ToUpperInvariant(); + } return $"{BookId}_{TradeType}_{LongShort}_{("场内期权".Equals(TradeType) ? ExchangeOptionCode : UnderlyingCode)}".ToUpperInvariant(); }