105 lines
4.3 KiB
C#
105 lines
4.3 KiB
C#
namespace YLErp.QdpModule.Constants
|
|
{
|
|
public class ConsVolInfos
|
|
{
|
|
public const string 财务 = "财务"; //结算
|
|
public const string 交易 = "交易";
|
|
public const string 报价Bid = "报价Bid";
|
|
public const string 报价Ask = "报价Ask";
|
|
public const string BidAsk = "BidAsk";
|
|
|
|
/// <summary>
|
|
/// 波动率曲面类型
|
|
/// </summary>
|
|
public static readonly IReadOnlyList<string> VolTypes = new List<string> { 交易, "风控", 财务, "客户", 报价Bid, 报价Ask, "其它" }.AsReadOnly();
|
|
|
|
public static readonly Dictionary<string, string> VolTypesFormat = new Dictionary<string, string>();
|
|
|
|
public static readonly IReadOnlyList<string> VolTypesWithOutAB = new List<string> { 交易, "风控", 财务, "客户", "隐含", "其它" }.AsReadOnly();
|
|
|
|
public static readonly IReadOnlyList<string> TradeVolTypes = new List<string>() { 交易, 报价Bid, 报价Ask }.AsReadOnly();
|
|
|
|
/// <summary>
|
|
/// 波动率模式
|
|
/// </summary>
|
|
public static readonly List<string> VolSurfaceModes = new List<string> { "MoneynessVol", "StrikeVol" };
|
|
|
|
/// <summary>
|
|
/// 波动率模式(国泰君安)
|
|
/// </summary>
|
|
public static readonly List<string> Gtja_VolSurfaceModes = new List<string> { "MoneynessVol" };
|
|
|
|
/// <summary>
|
|
/// MoneynessVol StrikeVol
|
|
/// </summary>
|
|
public static Dictionary<string, string> InterpolationMethods = new Dictionary<string, string>();
|
|
|
|
/// <summary>
|
|
/// 日终持仓风险波动率类型
|
|
/// </summary>
|
|
public static List<string> VolTypesForEodTradeRisk = new List<string> { "对冲", "持仓", "开仓" };
|
|
|
|
public const string defVolType = "交易";
|
|
public const string defVolMode = "MoneynessVol";
|
|
public const string defInterpolationMethod = ConsVolMethod.Default;
|
|
public const double defVol = ConsGlobal.DefaultVol;
|
|
public const double defOptId = -1;
|
|
public const string defOptName = "系统";
|
|
/// <summary>
|
|
/// 审核波动率下限
|
|
/// </summary>
|
|
public const double defReviewDownLimit = 0.3;
|
|
/// <summary>
|
|
/// 审核波动率上限
|
|
/// </summary>
|
|
public const double defReviewUpLimit = 0.7;
|
|
public static List<double> DefaultVolStrikeList = new List<double> { 2000, 2100, 2200 };
|
|
public static readonly List<double> DefaultMoneynessVolStrikeList = new List<double> { 0.9, 0.95, 1, 1.05, 1.1 };
|
|
public static readonly List<string> DefaultVolTenorList = new List<string> { "1D", "2M", "1Y" };
|
|
public static readonly IEnumerable<string> subTradeVolType = new List<string> { "报价Bid", "报价Ask" }.AsReadOnly();
|
|
|
|
static ConsVolInfos()
|
|
{
|
|
VolTypesFormat["交易Mid"] = 交易;
|
|
VolTypesFormat["风控"] = "风控";
|
|
VolTypesFormat[财务] = 财务;
|
|
VolTypesFormat["客户"] = "客户";
|
|
VolTypesFormat["交易Bid"] = 报价Bid;
|
|
VolTypesFormat["交易Ask"] = 报价Ask;
|
|
|
|
InterpolationMethods[ConsVolMethod.BiLinear] = ConsVolMethod.BiLinear;
|
|
InterpolationMethods[ConsVolMethod.BiCubicSpline] = ConsVolMethod.BiCubicSpline;
|
|
InterpolationMethods[ConsVolMethod.VarianceBiLinear] = ConsVolMethod.VarianceBiLinear;
|
|
InterpolationMethods[ConsVolMethod.VarianceBiCubicSpline] = ConsVolMethod.VarianceBiCubicSpline;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取波动率类型组
|
|
/// </summary>
|
|
public static List<string> GetVolTypes(string volType)
|
|
{
|
|
if (volType == 交易)
|
|
{
|
|
return new List<string>() { 交易, 报价Bid, 报价Ask };
|
|
}
|
|
return new List<string>() { volType };
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 波动率插值方法常量
|
|
/// </summary>
|
|
public class ConsVolMethod
|
|
{
|
|
public const string BiLinear = "BiLinear";
|
|
public const string BiCubicSpline = "BiCubicSpline";
|
|
public const string VarianceBiLinear = "VarianceBiLinear";
|
|
public const string VarianceBiCubicSpline = "VarianceBiCubicSpline";
|
|
|
|
/// <summary>
|
|
/// 默认波动率类型
|
|
/// </summary>
|
|
public const string Default = "BiLinear";
|
|
}
|
|
}
|