503 lines
17 KiB
C#
503 lines
17 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace YLErp.DBModels
|
|
{
|
|
[Table("valuedate")]
|
|
public class valuedate : IDataTrace
|
|
{
|
|
public const string 历史使用 = "历史使用";
|
|
public const string 当前使用 = "当前使用";
|
|
public static string LogClass = "系统估值日期";
|
|
|
|
public static readonly IEnumerable<string> BinaryOptionCalculationMethods = new List<string> { "Analytical", "Replication" }.AsReadOnly();
|
|
public static readonly IEnumerable<string> ThetaTypes = new List<string> { "交易日Theta", "日历日Theta" }.AsReadOnly();
|
|
public static readonly IEnumerable<string> BinaryOptionReplicationStrategies = new List<string> { "Down", "Middle" }.AsReadOnly();
|
|
public static readonly IEnumerable<string> DayCount = new List<string> { "Act365", "Bus244", "Bus245", "Bus243", "Bus252", "ActAct" }.AsReadOnly();
|
|
/// <summary>
|
|
/// 监管参数 持仓报送一年有效天数
|
|
/// </summary>
|
|
public static readonly IEnumerable<string> PositionReportDayCount = new List<string> { "Act365", "Bus244", "Bus245", "Bus243", "Bus252", "ActAct", "BusBus" }.AsReadOnly();
|
|
|
|
private static IEnumerable<string> _valueVanillaOptionMode = null;
|
|
/// <summary>
|
|
/// 美式香草期权定价模型
|
|
/// </summary>
|
|
public static IEnumerable<string> ValueVanillaOptionMode
|
|
{
|
|
get
|
|
{
|
|
if (_valueVanillaOptionMode == null)
|
|
{
|
|
//_valueVanillaOptionMode = (YLErp.PS.Config.Is光大光子 ? new List<string> { "BAW", "二叉树" } : new List<string> { "BAW" }).AsReadOnly();
|
|
_valueVanillaOptionMode = (new List<string> { "BAW", "二叉树" }).AsReadOnly();
|
|
}
|
|
return _valueVanillaOptionMode;
|
|
}
|
|
}
|
|
public static readonly IEnumerable<string> SettleDocModes = new List<string> { "单笔", "多笔" }.AsReadOnly();
|
|
public static readonly IEnumerable<string> TradeContractDocModes =
|
|
new List<string> { "单笔模式", "单客户同日", "单客户同日同类型", "单客户同日同类型同方向", "申银万国模式" }.AsReadOnly();
|
|
public static readonly IEnumerable<string> TradeContractModes = new List<string> { "卖方-甲方", "买方-甲方", "渠道商-甲方" }.AsReadOnly();
|
|
|
|
public static readonly List<string> EodSettlePriceModes = new List<string> { "收盘价" };//"结算价",
|
|
public static readonly IEnumerable<string> PotentialSurplusCalcModes = new List<string> { "实值计算", "虚值计算" }.AsReadOnly();
|
|
|
|
//报价周期可选项
|
|
public static readonly IEnumerable<string> QuotationCycleType = new List<string> { "1W", "2W", "1M", "45D", "2M", "3M", "4M" }.AsReadOnly();
|
|
|
|
public const string SettleDocModeSingle = "单笔";
|
|
public const string SettleDocModeMultiple = "多笔";
|
|
|
|
public const string TradeContractModeSellerForFirst = "卖方-甲方";
|
|
public const string TradeContractModeBuyerForFirst = "买方-甲方";
|
|
public const string TradeContractModeBrokerForFirst = "渠道商-甲方";
|
|
|
|
public const string PotentialSurplusCalcMode_ActualPv = "实值计算";
|
|
public const string PotentialSurplusCalcMode_Pv = "虚值计算";
|
|
|
|
[NotMapped]
|
|
public SystemConfigData ConfigInfoData
|
|
{
|
|
get
|
|
{
|
|
if (string.IsNullOrEmpty(ConfigInfo))
|
|
{
|
|
return new SystemConfigData();
|
|
}
|
|
|
|
return JsonHelper.Parse<SystemConfigData>(ConfigInfo);
|
|
}
|
|
}
|
|
|
|
public string ConfigInfo { get; set; }
|
|
|
|
/// <summary>
|
|
/// 真实行权费率
|
|
/// </summary>
|
|
[NotMapped]
|
|
[DisplayName("行权费率")]
|
|
public double? ExerciseCostRatioReal { get { return (ExerciseCostRatio ?? 0) / 10000; } }
|
|
|
|
/// <summary>
|
|
/// 万分之单位
|
|
/// </summary>
|
|
[DisplayName("行权费率")]
|
|
public double? ExerciseCostRatio { get; set; }
|
|
|
|
/// <summary>
|
|
/// 交易特批
|
|
/// </summary>
|
|
[DisplayName("交易特批")]
|
|
public int? SpecialOperateForTrade { get; set; }
|
|
|
|
/// <summary>
|
|
/// 出金特批
|
|
/// </summary>
|
|
[DisplayName("出金特批")]
|
|
public int? SpecialOperateForCashOut { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否需要平仓行权复核
|
|
/// </summary>
|
|
[DisplayName("是否需要平仓行权复核")]
|
|
public int? CloseReCheck { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否需要平仓行权审批
|
|
/// </summary>
|
|
[DisplayName("是否需要平仓行权审批")]
|
|
public int? CloseReApprove { get; set; }
|
|
|
|
[DisplayName("无风险利率")]
|
|
public double? RiskFreeRate { get; set; }
|
|
|
|
[DisplayName("扩展无风险利率")]
|
|
public double? RiskFreeRateExtend { get; set; }
|
|
|
|
[DisplayName("利率曲线")]
|
|
public string RiskFreeCurveData { get; set; }
|
|
|
|
[DisplayName("二元期权计算方法")]
|
|
public string BinaryCalculation { get; set; }
|
|
|
|
[DisplayName("Theta类型")]
|
|
public string ThetaType { get; set; }
|
|
[DisplayName("二元期权复制策略")]
|
|
public string BinaryReplicationStrategy { get; set; }
|
|
[DisplayName("开启客户报价计算")]
|
|
public int? EnableClientCalculation { get; set; }
|
|
|
|
[DisplayName("开启手机端实时报价")]
|
|
public int? EnableMobileQuotation { get; set; }
|
|
|
|
[DisplayName("手机端报价是否展示波动率报价")]
|
|
public int? EnableMobileVolQuote { get; set; }
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[Key]
|
|
|
|
public int id { set; get; }
|
|
/// <summary>
|
|
/// 估值日期
|
|
/// </summary>
|
|
[DisplayName("估值日期")]
|
|
|
|
public DateTime ValueDate { set; get; }
|
|
/// <summary>
|
|
/// 状态
|
|
/// </summary>
|
|
[DisplayName("状态")]
|
|
public string State { set; get; } = "";
|
|
/// <summary>
|
|
/// 是否自动更新时间,true就自动更新,false不是自动更新
|
|
/// </summary>
|
|
[DisplayName("类型")]
|
|
|
|
public string Type { set; get; } = "";
|
|
|
|
/// <summary>
|
|
/// 是否自动更新时间
|
|
/// </summary>
|
|
[NotMapped]
|
|
public bool IsAutoUpdate
|
|
{
|
|
get { return Type != "false"; }
|
|
}
|
|
/// <summary>
|
|
/// 操作员_optid
|
|
/// </summary>
|
|
[DisplayName("操作员")]
|
|
|
|
public int? OptId { set; get; }
|
|
/// <summary>
|
|
/// 操作员_optname
|
|
/// </summary>
|
|
[DisplayName("操作员")]
|
|
|
|
public string OptName { set; get; } = "";
|
|
/// <summary>
|
|
/// 更新时间_updatedate
|
|
/// </summary>
|
|
[DisplayName("更新时间")]
|
|
|
|
public DateTime? UpdateTime { set; get; }
|
|
/// <summary>
|
|
/// 创建时间_createdate
|
|
/// </summary>
|
|
[DisplayName("创建时间")]
|
|
|
|
public DateTime? CreateTime { set; get; }
|
|
|
|
//[DisplayName("对冲风险实时刷新频率")]
|
|
//public int RiskHedgingRefreshPeriod { get; set; }
|
|
|
|
[DisplayName("CurveDayCount")] public string CurveDayCount { get; set; } = "Act365";
|
|
|
|
[DisplayName("TradeDayCount")] public string TradeDayCount { get; set; } = "Bus244";
|
|
|
|
|
|
[DisplayName("持仓报送报告的一年有效天数")] public string PositionReportTradeDayCount { get; set; } = "Act365";
|
|
|
|
[DisplayName("延迟")]
|
|
public int Delay { get; set; }
|
|
|
|
/// <summary>
|
|
/// 1表示备兑
|
|
/// </summary>
|
|
[DisplayName("备兑")]
|
|
public int IsCovered { get; set; }
|
|
|
|
[DisplayName("预付金比率")]
|
|
public double? MarginRatio { get; set; }
|
|
|
|
[DisplayName("商品期货预付金比率")]
|
|
public double? FutureMarginRatio { get; set; }
|
|
|
|
[DisplayName("商品预付金加点")]
|
|
public double? FutureMarginAddRatio { get; set; }
|
|
|
|
[DisplayName("波动率调整比")]
|
|
public double? VolatilityRatio { get; set; }
|
|
|
|
[DisplayName("默认通道簿记账户")]
|
|
public string DefaultAssetUnit { get; set; }
|
|
|
|
[DisplayName("Delta系数")]
|
|
public double? FutureMarginDeltaCoefficient { get; set; }
|
|
|
|
[DisplayName("Vega系数")]
|
|
public double? FutureMarginVegaCoefficient { get; set; }
|
|
|
|
[DisplayName("Omega系数")]
|
|
public double? FutureMarginOmegaCoefficient { get; set; }
|
|
|
|
[DisplayName("Alpha倍率")]
|
|
public double? FutureMarginAlphaRate { get; set; }
|
|
|
|
[DisplayName("商品期权初始预付金")]
|
|
public double? FutureInitialMarginRatio { get; set; }
|
|
|
|
[DisplayName("清算书生成模式")]
|
|
public string SettleDocMode { get; set; }
|
|
|
|
[DisplayName("交易书甲乙方模式")]
|
|
public string TradeContractMode { get; set; }
|
|
|
|
[DisplayName("交易确认书生成模式")]
|
|
public string TradeContractDocMode { get; set; }
|
|
|
|
[DisplayName("批量导入行权检查误差范围")]
|
|
public double? UploadExerciseScope { get; set; }
|
|
|
|
[DisplayName("结算价格模式")]
|
|
public string EodSettlePriceMode { get; set; }
|
|
|
|
[DisplayName("结算波动率")]
|
|
public string EodSettleVolMode { get; set; }
|
|
|
|
[DisplayName("潜在行权盈余是否算入预付金余额")]
|
|
public int? IsPotentialSurplusUseMargin { get; set; }
|
|
|
|
[DisplayName("潜在行权盈余计算模式")]
|
|
public string PotentialSurplusCalcMode { get; set; }
|
|
|
|
[DisplayName("累计盈亏统计起始日")]
|
|
public DateTime? AccruedTotalPnlStartDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否客户端下单自动撤销
|
|
/// </summary>
|
|
[DisplayName("客户端下单自动撤销")]
|
|
public bool IsAutoRebackOrder { get; set; }
|
|
|
|
[DisplayName("自动撤单延迟时间")]
|
|
public int AutoRebackOrderDelay { get; set; }
|
|
|
|
/// <summary>
|
|
/// 监管报告主体名称
|
|
/// </summary>
|
|
[DisplayName("监管报告主体名称")]
|
|
public string SuperviseMainName { get; set; }
|
|
|
|
/// <summary>
|
|
/// 监管报告主体的统一社会信用代码
|
|
/// </summary>
|
|
[DisplayName("监管报告主体的统一社会信用代码")]
|
|
public string SuperviseMainCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// 报价周期
|
|
/// </summary>
|
|
[DisplayName("报价周期")]
|
|
public string QuotationCycle { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否可使用担保品
|
|
/// </summary>
|
|
[DisplayName("是否可使用担保品")]
|
|
public bool PartyUseColl
|
|
{
|
|
get { return false; }
|
|
set {; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 担保品使用说明
|
|
/// </summary>
|
|
[DisplayName("担保品使用说明")]
|
|
public string CollInstruction
|
|
{
|
|
get { return "无"; }
|
|
set {; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 开户审批是否受限于双录预约
|
|
/// </summary>
|
|
[DisplayName("开户审批是否受限于双录预约")]
|
|
public bool IsClientNeedBook { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否能设置初始预付金
|
|
/// </summary>
|
|
[DisplayName("是否能设置初始预付金")]
|
|
public bool CanSetInitialMargin { get; set; }
|
|
|
|
/// <summary>
|
|
/// 客户端声明
|
|
/// </summary>
|
|
[DisplayName("客户端声明")]
|
|
public string ClientDesc { get; set; }
|
|
|
|
/// <summary>
|
|
/// 监管报告文件前缀
|
|
/// </summary>
|
|
[DisplayName("监管报告文件前缀")]
|
|
public string SupervisePrefix { get; set; }
|
|
|
|
/// <summary>
|
|
/// 除权除息分红税
|
|
/// </summary>
|
|
[DisplayName("除权除息分红税率")]
|
|
public double DividendRate { get; set; }
|
|
/// <summary>
|
|
/// 同业追保起点
|
|
/// </summary>
|
|
[DisplayName("同业追保起点")]
|
|
public double SamePeerMarginCallPoint { get; set; }
|
|
|
|
/// <summary>
|
|
/// 预付金保底收益率(海通)
|
|
/// </summary>
|
|
[DisplayName("预付金保底收益率(海通)")]
|
|
public double? GuaranteedIncome { get; set; }
|
|
|
|
/// <summary>
|
|
/// 业务合约总规模
|
|
/// </summary>
|
|
[DisplayName("业务合约总规模")]
|
|
public double? BusinessTotalScale { get; set; }
|
|
|
|
/// <summary>
|
|
/// 业务投入资金
|
|
/// </summary>
|
|
[DisplayName("业务投入资金")]
|
|
public double? BusinessAvailableFunds { get; set; }
|
|
|
|
/// <summary>
|
|
/// 单标的品种合约总规模占业务合约总规模比例上限
|
|
/// </summary>
|
|
[DisplayName("单标的品种合约总规模占业务合约总规模比例上限")]
|
|
public double? SingleUnderlyingRate { get; set; }
|
|
|
|
/// <summary>
|
|
/// 交易确认成交前和确认成交时要不要执行试算逻辑
|
|
/// </summary>
|
|
[DisplayName("交易试算")]
|
|
public bool TradeTrial { get; set; }
|
|
|
|
/// <summary>
|
|
/// 敲入触碰预警偏差值
|
|
/// </summary>
|
|
[DisplayName("敲入触碰预警偏差值")]
|
|
public double AlertLineKonckInLimit { get; set; }
|
|
|
|
/// <summary>
|
|
/// 敲出触碰预警偏差值
|
|
/// </summary>
|
|
[DisplayName("敲出触碰预警偏差值")]
|
|
public double AlertLineKonckOutLimit { get; set; }
|
|
|
|
/// <summary>
|
|
/// 编辑交易时必须填写备注
|
|
/// </summary>
|
|
[DisplayName("编辑交易时必须填写备注")]
|
|
public bool EditTradeNeedRemark { get; set; }
|
|
|
|
/// <summary>
|
|
/// 信用风险敞口-CCR计算参数j
|
|
/// </summary>
|
|
[DisplayName("信用风险敞口-CCR计算参数j")]
|
|
public double RiskExposureJ { get; set; }
|
|
|
|
/// <summary>
|
|
/// 信用风险敞口-CCR计算参数N
|
|
/// </summary>
|
|
[DisplayName("信用风险敞口-CCR计算参数N")]
|
|
public double RiskExposureN { get; set; }
|
|
|
|
/// <summary>
|
|
/// 预付金-CCR计算参数j
|
|
/// </summary>
|
|
[DisplayName("预付金-CCR计算参数j")]
|
|
public double MarginJ { get; set; }
|
|
|
|
/// <summary>
|
|
/// 预付金-CCR计算参数N
|
|
/// </summary>
|
|
[DisplayName("预付金-CCR计算参数N")]
|
|
public double MarginN { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 平仓单价视角(0:价值视角;1:结算视角)
|
|
/// 平仓单价平仓总额视角情况:
|
|
/// 平仓单价:价值视角;平仓总额:价值视角、结算视角
|
|
/// 平仓单价:结算视角;平仓总额:结算视角
|
|
/// </summary>
|
|
[DisplayName("平仓单价视角")]
|
|
public int UnwindSinglePriceAngle { get; set; }
|
|
/// <summary>
|
|
/// 平仓总额视角(0:价值视角;1:结算视角)
|
|
/// </summary>
|
|
[DisplayName("平仓总额视角")]
|
|
public int UnwindAmountAngle { get; set; }
|
|
|
|
/// <summary>
|
|
/// 双向预付金启用日期
|
|
/// </summary>
|
|
[DisplayName("双向预付金启用日期")]
|
|
public DateTime? TwoSideMarginValueDate { get; set; }
|
|
|
|
|
|
public string AssetIds { get; set; }
|
|
|
|
public valuedate Clone()
|
|
{
|
|
return (valuedate)MemberwiseClone();
|
|
}
|
|
|
|
public string GetDataTraceKeyInfo()
|
|
{
|
|
return "交易参数";
|
|
}
|
|
}
|
|
|
|
public class SystemConfigData
|
|
{
|
|
/// <summary>
|
|
/// 美式香草期权定价模型
|
|
/// </summary>
|
|
public string ValueVanillaOptionMode { get; set; }
|
|
///// <summary>
|
|
///// 是否启用税率
|
|
///// </summary>
|
|
//public bool IsUseTax { get; set; }
|
|
///// <summary>
|
|
///// 政府规定的分割月数
|
|
///// </summary>
|
|
//public int MaxStockMonth { get; set; }
|
|
///// <summary>
|
|
///// 小于规定月数的派息税
|
|
///// </summary>
|
|
//public double DividendRate_Before { get; set; }
|
|
///// <summary>
|
|
///// 大于规定月数的派息税
|
|
///// </summary>
|
|
//public double DividendRate { get; set; }
|
|
/// <summary>
|
|
/// 预付金名义本金占比
|
|
/// </summary>
|
|
public int StockEqvNotionalRatio { get; set; } = -5;
|
|
/// <summary>
|
|
/// 一般掉期初始预付金
|
|
/// </summary>
|
|
public int NormalSwapInitMarginRatio { get; set; } = 15;
|
|
/// <summary>
|
|
/// 基差掉期初始预付金
|
|
/// </summary>
|
|
public int BasisSwapInitMarginRatio { get; set; } = 10;
|
|
/// <summary>
|
|
/// 一般掉期持仓预付金
|
|
/// </summary>
|
|
public int NormalSwapMarginRatio { get; set; } = 15;
|
|
/// <summary>
|
|
/// 基差掉期持仓预付金
|
|
/// </summary>
|
|
public int BasisSwapMarginRatio { get; set; } = 10;
|
|
}
|
|
}
|