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(); }