diff --git a/Framework/YLErp.Core/DBModels/Consts/ConsTrade.cs b/Framework/YLErp.Core/DBModels/Consts/ConsTrade.cs
index 494a0fc7..cd243a6a 100644
--- a/Framework/YLErp.Core/DBModels/Consts/ConsTrade.cs
+++ b/Framework/YLErp.Core/DBModels/Consts/ConsTrade.cs
@@ -110,7 +110,7 @@ namespace YLErp.DBModels
///
/// 对冲结构类型
///
- public static readonly List TradeTypesForHedge = new List { "商品期货", "商品现货", "股票", "场内期权" };
+ public static readonly List TradeTypesForHedge = new List { "商品期货", "商品现货", "股票", "场内期权","信用债" };
///
/// 非期权结构类型(包括结构化交易)
@@ -125,7 +125,7 @@ namespace YLErp.DBModels
///
public static readonly List SpreadPayoffTypes = new List { "S1-S2", "S1-S2-S3", "S1-S2-S3", "S1+S2-S3", "S1-S2-S3-S4", "S1+S2-S3-S4", "S1+S2+S3-S4" };
- public static readonly List TradeTypesForStockRiskHedging = new List { "香草期权", "亚式期权", "商品期货", "股票" };
+ public static readonly List TradeTypesForStockRiskHedging = new List { "香草期权", "亚式期权", "商品期货", "股票", "信用债" };
public static readonly List BarrierTypes = new List { "上升敲入", "上升敲出", "下降敲入", "下降敲出", "双障碍敲入", "双障碍敲出" };
///
diff --git a/UnitTestProject/OldVersion/OptionCalculatorV1.cs b/UnitTestProject/OldVersion/OptionCalculatorV1.cs
index 3aa739a5..50a269ec 100644
--- a/UnitTestProject/OldVersion/OptionCalculatorV1.cs
+++ b/UnitTestProject/OldVersion/OptionCalculatorV1.cs
@@ -7367,6 +7367,7 @@ namespace YLErp.OldVersion
case "远期":
result = ForwardradeCalcService.CalcValue(trade, spotPrices[0]);
break;
+ case "信用债":
case "商品期货":
case "商品现货":
case "股票":
diff --git a/YLErpDAL/BLL/Calculation/V2/ParameterHelper.cs b/YLErpDAL/BLL/Calculation/V2/ParameterHelper.cs
index fe4d9e2b..23360acf 100644
--- a/YLErpDAL/BLL/Calculation/V2/ParameterHelper.cs
+++ b/YLErpDAL/BLL/Calculation/V2/ParameterHelper.cs
@@ -51,6 +51,7 @@ namespace YLErp.BLL.Calculation.V2
return CreateAirbagParameter(trade, underlying, variety, vols, spotPrices, preciseTimeMode, discountCurveName, timeToMaturityDays, engineName);
case "收益增强结构":
return CreateUnderlyingEnhanceParameter(trade, underlying, variety, vols, spotPrices, preciseTimeMode, discountCurveName, timeToMaturityDays, engineName);
+ case "信用债":
case "商品期货":
case "股票":
return CreateUnderlyingProductParameter(underlying, spotPrices);
diff --git a/YLErpDAL/BLL/Calculation/V2/ValueCalculator.cs b/YLErpDAL/BLL/Calculation/V2/ValueCalculator.cs
index e8330723..b50ffa69 100644
--- a/YLErpDAL/BLL/Calculation/V2/ValueCalculator.cs
+++ b/YLErpDAL/BLL/Calculation/V2/ValueCalculator.cs
@@ -132,6 +132,7 @@ namespace YLErp.BLL.Calculation.V2
}
return CalculateForward(trade.Strike ?? 0.0, spotPrice, trade.Notional, trade.CallPut);
}
+ case "信用债":
case "商品期货":
case "商品现货":
case "股票":
diff --git a/YLErpDAL/BLL/MarginCalculation/GTJAMarginCalculation.cs b/YLErpDAL/BLL/MarginCalculation/GTJAMarginCalculation.cs
index be3ff5db..79d420b1 100644
--- a/YLErpDAL/BLL/MarginCalculation/GTJAMarginCalculation.cs
+++ b/YLErpDAL/BLL/MarginCalculation/GTJAMarginCalculation.cs
@@ -2009,6 +2009,7 @@ namespace YLErp.BLL.MarginCalculation
}
optionValue = ForwardradeCalcService.CalcValue(td, closePrice);
break;
+ case "信用债":
case "商品期货":
case "股票":
optionValue = new TradeValueResult { Pv = closePrice * td.Notional, Delta = td.Notional, DeltaCash = closePrice * td.Notional };
diff --git a/YLErpDAL/Commons/GlobalDicionary.cs b/YLErpDAL/Commons/GlobalDicionary.cs
index e29191c3..62434f1e 100644
--- a/YLErpDAL/Commons/GlobalDicionary.cs
+++ b/YLErpDAL/Commons/GlobalDicionary.cs
@@ -5,7 +5,7 @@
///
/// 当前系统支持计算的结构类型,
///
- public readonly static List SupportTradeTypes = new List { "远期", "股票", "场内期权", "商品期货", "香草期权",
+ public readonly static List SupportTradeTypes = new List { "远期", "股票", "场内期权", "商品期货","信用债", "香草期权",
"二元期权", "障碍期权", "亚式期权", "价差期权", "合成价差期权", "结构化交易", "自定义交易", "双鲨期权", "凤凰期权", "雪球期权",
"区间累积期权", "收益互换", "气囊结构", "收益增强结构","现金流交易" ,"累计期权","结构化产品","Risky期权"};
}
diff --git a/YLErpDAL/CustomizedBizLogic/BizLogicMaoChuan.cs b/YLErpDAL/CustomizedBizLogic/BizLogicMaoChuan.cs
index 6a930e3d..966977a6 100644
--- a/YLErpDAL/CustomizedBizLogic/BizLogicMaoChuan.cs
+++ b/YLErpDAL/CustomizedBizLogic/BizLogicMaoChuan.cs
@@ -41,6 +41,7 @@ namespace YLErp.CustomizedBizLogic
case "亚式期权":
case "彩虹期权":
case "价差期权":
+ case "信用债":
case "商品期货":
case "商品现货":
case "股票":
diff --git a/YLErpDAL/Model/TradingRiskParameter.cs b/YLErpDAL/Model/TradingRiskParameter.cs
index df2f463b..d949d7d0 100644
--- a/YLErpDAL/Model/TradingRiskParameter.cs
+++ b/YLErpDAL/Model/TradingRiskParameter.cs
@@ -649,7 +649,7 @@ namespace YLErp.Models
{
tempTrp = viewList.FirstOrDefault(t => ConsTrade.TradeTypesForHedge.Contains(t.TradeType) && t.UnderlyingCode == trp.UnderlyingCode && t.TradeType != "场内期权");
}
- if ((trp.TradeType == "股票" || trp.TradeType == "商品期货") && string.IsNullOrWhiteSpace(trp.CallPut))
+ if ((trp.TradeType == "股票" || trp.TradeType == "商品期货" || trp.TradeType == "信用债") && string.IsNullOrWhiteSpace(trp.CallPut))
{
trp.CallPut = trp.Notional >= 0 ? ConsGlobal.CallPut.Call : ConsGlobal.CallPut.Put;
}
diff --git a/YLErpDAL/Modules/CalculationModule/ExchangeTradeCommissionCalc.cs b/YLErpDAL/Modules/CalculationModule/ExchangeTradeCommissionCalc.cs
index e6966b55..bc851e55 100644
--- a/YLErpDAL/Modules/CalculationModule/ExchangeTradeCommissionCalc.cs
+++ b/YLErpDAL/Modules/CalculationModule/ExchangeTradeCommissionCalc.cs
@@ -52,7 +52,7 @@ namespace YLErp.Modules.CalculationModule
foreach (var td in tradeList)
{
- if (td.TradeType == "商品期货")
+ if (td.TradeType == "商品期货" || td.TradeType == "信用债")
{
continue;
}
diff --git a/YLErpDAL/Modules/CalculationModule/SimpleOtcTradeRiskCalc.cs b/YLErpDAL/Modules/CalculationModule/SimpleOtcTradeRiskCalc.cs
index 2d7e6a1f..1be78f20 100644
--- a/YLErpDAL/Modules/CalculationModule/SimpleOtcTradeRiskCalc.cs
+++ b/YLErpDAL/Modules/CalculationModule/SimpleOtcTradeRiskCalc.cs
@@ -319,6 +319,7 @@ namespace YLErp.Modules.CalculationModule
result = ForwardradeCalcService.CalcValue(td, spotPrice);
}
break;
+ case "信用债":
case "商品期货":
_priceProvider.TryGetPrice(td.UnderlyingCode, out var spotPriceGet);
result = new TradeValueResult()
diff --git a/YLErpDAL/Modules/CalculationModule/TradeCalcHelper.cs b/YLErpDAL/Modules/CalculationModule/TradeCalcHelper.cs
index 84dab697..a37aa6f1 100644
--- a/YLErpDAL/Modules/CalculationModule/TradeCalcHelper.cs
+++ b/YLErpDAL/Modules/CalculationModule/TradeCalcHelper.cs
@@ -86,6 +86,7 @@ namespace YLErp.Modules.CalculationModule
{
switch (TradeType)
{
+ case "信用债":
case "商品期货":
case "场内期权":
return BuySell.Contains("多头") ? "long" : "short";
diff --git a/YLErpDAL/Modules/CalculationModule/TradeRiskValueCalc.cs b/YLErpDAL/Modules/CalculationModule/TradeRiskValueCalc.cs
index 310e0e2f..4811a34e 100644
--- a/YLErpDAL/Modules/CalculationModule/TradeRiskValueCalc.cs
+++ b/YLErpDAL/Modules/CalculationModule/TradeRiskValueCalc.cs
@@ -132,6 +132,7 @@ namespace YLErp.Modules.CalculationModule
}
optionValue = ForwardradeCalcService.CalcValue(_trade, spotPrice);
break;
+ case "信用债":
case "商品期货":
case "股票":
{
diff --git a/YLErpDAL/Modules/EodModule/AccruedTotalPnlService.cs b/YLErpDAL/Modules/EodModule/AccruedTotalPnlService.cs
index 13045c04..c686587e 100644
--- a/YLErpDAL/Modules/EodModule/AccruedTotalPnlService.cs
+++ b/YLErpDAL/Modules/EodModule/AccruedTotalPnlService.cs
@@ -440,7 +440,8 @@ namespace YLErp.Modules.EodModule
{
"场内期权",
"商品期货",
- "股票"
+ "股票",
+ "信用债"
};
var sourceQuery = from t in DbContext.Set().Where(t => t.ValueDate >= startDate && t.ValueDate <= endDate && tradeTypes.Contains(t.TradeType))
join un in DbContext.underlying_manager on t.UnderlyingCode equals un.UnderlyingCode
diff --git a/YLErpDAL/Modules/ScenarioModule/ScenarioCalcService.cs b/YLErpDAL/Modules/ScenarioModule/ScenarioCalcService.cs
index c161b028..7a4b7bc6 100644
--- a/YLErpDAL/Modules/ScenarioModule/ScenarioCalcService.cs
+++ b/YLErpDAL/Modules/ScenarioModule/ScenarioCalcService.cs
@@ -692,7 +692,7 @@ namespace YLErp.Modules.ScenarioModule
//获取计算结果
private TradeValueResult GetCallResult(trade td, CalcData calcData)
{
- if (td.TradeType == "商品期货" || td.TradeType == "股票" || td.TradeType == "商品现货")
+ if (td.TradeType == "商品期货" || td.TradeType == "股票" || td.TradeType == "商品现货" || td.TradeType == "信用债")
{
var pv = td.Notional * calcData.SpotPrice;
diff --git a/YLErpWeb/Views/trade/tradeEndConfirmList.cshtml b/YLErpWeb/Views/trade/tradeEndConfirmList.cshtml
index 3c44ffaf..e2a2a945 100644
--- a/YLErpWeb/Views/trade/tradeEndConfirmList.cshtml
+++ b/YLErpWeb/Views/trade/tradeEndConfirmList.cshtml
@@ -18,7 +18,7 @@
IsZheQi = PS.Config.Is浙期,
IsAutoSealGeneratedBook = YLErp.PS.GetErpConfig().IsAutoSealAfterGeneratedBook
};
- var tradeTypes = ConsTrade.AllTradeTypes.Except(new List { "场内期权", "商品期货", "股票" }).Concat(new List { "黑箱结构" });
+ var tradeTypes = ConsTrade.AllTradeTypes.Except(new List { "场内期权", "商品期货", "股票","信用债" }).Concat(new List { "黑箱结构" });
}
@section CSS{