Merge remote-tracking branch 'origin/glms/feature/1.4.2' into glms/feature/1.4.2
This commit is contained in:
@@ -110,7 +110,7 @@ namespace YLErp.DBModels
|
||||
/// <summary>
|
||||
/// 对冲结构类型
|
||||
/// </summary>
|
||||
public static readonly List<string> TradeTypesForHedge = new List<string> { "商品期货", "商品现货", "股票", "场内期权" };
|
||||
public static readonly List<string> TradeTypesForHedge = new List<string> { "商品期货", "商品现货", "股票", "场内期权","信用债" };
|
||||
|
||||
/// <summary>
|
||||
/// 非期权结构类型(包括结构化交易)
|
||||
@@ -125,7 +125,7 @@ namespace YLErp.DBModels
|
||||
/// </summary>
|
||||
public static readonly List<string> SpreadPayoffTypes = new List<string> { "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<string> TradeTypesForStockRiskHedging = new List<string> { "香草期权", "亚式期权", "商品期货", "股票" };
|
||||
public static readonly List<string> TradeTypesForStockRiskHedging = new List<string> { "香草期权", "亚式期权", "商品期货", "股票", "信用债" };
|
||||
|
||||
public static readonly List<string> BarrierTypes = new List<string> { "上升敲入", "上升敲出", "下降敲入", "下降敲出", "双障碍敲入", "双障碍敲出" };
|
||||
/// <summary>
|
||||
|
||||
@@ -7367,6 +7367,7 @@ namespace YLErp.OldVersion
|
||||
case "远期":
|
||||
result = ForwardradeCalcService.CalcValue(trade, spotPrices[0]);
|
||||
break;
|
||||
case "信用债":
|
||||
case "商品期货":
|
||||
case "商品现货":
|
||||
case "股票":
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -132,6 +132,7 @@ namespace YLErp.BLL.Calculation.V2
|
||||
}
|
||||
return CalculateForward(trade.Strike ?? 0.0, spotPrice, trade.Notional, trade.CallPut);
|
||||
}
|
||||
case "信用债":
|
||||
case "商品期货":
|
||||
case "商品现货":
|
||||
case "股票":
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/// <summary>
|
||||
/// 当前系统支持计算的结构类型,
|
||||
/// </summary>
|
||||
public readonly static List<string> SupportTradeTypes = new List<string> { "远期", "股票", "场内期权", "商品期货", "香草期权",
|
||||
public readonly static List<string> SupportTradeTypes = new List<string> { "远期", "股票", "场内期权", "商品期货","信用债", "香草期权",
|
||||
"二元期权", "障碍期权", "亚式期权", "价差期权", "合成价差期权", "结构化交易", "自定义交易", "双鲨期权", "凤凰期权", "雪球期权",
|
||||
"区间累积期权", "收益互换", "气囊结构", "收益增强结构","现金流交易" ,"累计期权","结构化产品","Risky期权"};
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace YLErp.CustomizedBizLogic
|
||||
case "亚式期权":
|
||||
case "彩虹期权":
|
||||
case "价差期权":
|
||||
case "信用债":
|
||||
case "商品期货":
|
||||
case "商品现货":
|
||||
case "股票":
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace YLErp.Modules.CalculationModule
|
||||
|
||||
foreach (var td in tradeList)
|
||||
{
|
||||
if (td.TradeType == "商品期货")
|
||||
if (td.TradeType == "商品期货" || td.TradeType == "信用债")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -86,6 +86,7 @@ namespace YLErp.Modules.CalculationModule
|
||||
{
|
||||
switch (TradeType)
|
||||
{
|
||||
case "信用债":
|
||||
case "商品期货":
|
||||
case "场内期权":
|
||||
return BuySell.Contains("多头") ? "long" : "short";
|
||||
|
||||
@@ -132,6 +132,7 @@ namespace YLErp.Modules.CalculationModule
|
||||
}
|
||||
optionValue = ForwardradeCalcService.CalcValue(_trade, spotPrice);
|
||||
break;
|
||||
case "信用债":
|
||||
case "商品期货":
|
||||
case "股票":
|
||||
{
|
||||
|
||||
@@ -440,7 +440,8 @@ namespace YLErp.Modules.EodModule
|
||||
{
|
||||
"场内期权",
|
||||
"商品期货",
|
||||
"股票"
|
||||
"股票",
|
||||
"信用债"
|
||||
};
|
||||
var sourceQuery = from t in DbContext.Set<TEntity>().Where(t => t.ValueDate >= startDate && t.ValueDate <= endDate && tradeTypes.Contains(t.TradeType))
|
||||
join un in DbContext.underlying_manager on t.UnderlyingCode equals un.UnderlyingCode
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
IsZheQi = PS.Config.Is浙期,
|
||||
IsAutoSealGeneratedBook = YLErp.PS.GetErpConfig().IsAutoSealAfterGeneratedBook
|
||||
};
|
||||
var tradeTypes = ConsTrade.AllTradeTypes.Except(new List<string> { "场内期权", "商品期货", "股票" }).Concat(new List<string> { "黑箱结构" });
|
||||
var tradeTypes = ConsTrade.AllTradeTypes.Except(new List<string> { "场内期权", "商品期货", "股票","信用债" }).Concat(new List<string> { "黑箱结构" });
|
||||
}
|
||||
@section CSS{
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user