using Qdp.Pricing.Base.Utilities; using YLErp.BLL; using YLErp.Commons; namespace YLErp.Modules.SuperviseReportModule.CFMMC.Model { public class SuperviseReportPositionModel : SuperviseReportBaseModel { /// /// 持仓日期 /// public DateTime? PositionDate { get; set; } /// /// 持仓日期 /// public string PositionDateString { get { return PositionDate == null ? "" : PositionDate.Value.ToString("yyyy-MM-dd"); } } private double _vol; /// /// 估值波动率 /// public double Vol { get { return _vol; } set { _vol = OtcFormatHelper.FormatValue(value, 4); } } /// /// 合约估值时标的价格 /// public string InitialSpotPrice { get; set; } private int _annualDays; /// /// 一年有效天数 /// public int AnnualDays { get { if (_annualDays == 0) { var dayCount = valuedateBLL.TradeDayCount.ToDayCountImpl(); var today = this.trade?.TradeDate ?? throw new Exception("交易日期不应为空"); var oneYear = today.AddYears(1); _annualDays = (int)dayCount.DaysInPeriod(new Qdp.Foundation.Implementations.Date(today), new Qdp.Foundation.Implementations.Date(oneYear)); } return _annualDays; } set { _annualDays = value; } } public string Delta { get; set; } internal double? InnerGamma { get; set; } internal string CrossGamma { get; set; } public string Gamma => CrossGamma.TrimToNull() ?? InnerGamma.OtcFormat(OtcFormatFlag.greek); private double? _vega; public double? Vega { get { return _vega; } set { _vega = value.OtcFormatValue(OtcFormatFlag.greek); } } private double? _theta; public double? Theta { get { return _theta; } set { _theta = value.OtcFormatValue(OtcFormatFlag.greek); } } private double? _rho; public double? Rho { get { return _rho; } set { _rho = value.OtcFormatValue(OtcFormatFlag.greek); } } private double _noRiskRate; /// /// 无风险利率 /// public double NoRiskRate { get { return _noRiskRate; } set { _noRiskRate = OtcFormatHelper.FormatValue(value, 6); } } private double _discountRage; /// /// 贴现率 /// public double DiscountRate { get { return _discountRage; } set { _discountRage = OtcFormatHelper.FormatValue(value, 6); } } private double _gammaCash; /// /// GammaCash /// public double GammaCash { get => _gammaCash; set => _gammaCash = value.OtcFormatValue(OtcFormatFlag.greek); } #region 雪球期权信息 private string _snowType; /// /// 雪球分类 /// public string SnowType { get => _snowType; set => _snowType = value; } private string _snowStatus; /// /// 雪球期权状态 /// public string SnowStatus { get => _snowStatus; set => _snowStatus = value; } private string _snowStructureInfo; /// /// 雪球结构要素 /// public string SnowStructureInfo { get => _snowStructureInfo; set => _snowStructureInfo = value; } private string _clientType; /// /// 交易对手类型 /// public string ClientType { get => _clientType; set => _clientType = value; } private string _koObservationDates; /// /// 敲出观察日期 /// public string KOObservationDates { get => _koObservationDates; set => _koObservationDates = value; } private string _koBarrier; //敲出观察价格 public string KOBarrier { get => _koBarrier; set => _koBarrier = value; } private string _kiObservationDates; /// /// 敲入观察日期 /// public string KIObservationDates { get => _kiObservationDates; set => _kiObservationDates = value; } private double? _kiBarrier; //敲入观察价格 public double? KIBarrier { get => _kiBarrier; set { if (PS.Config.Company == Configuration.CompanyEnum.国投) { _kiBarrier = OtcFormatHelper.FormatValue(value ?? 0, 2); } else { _kiBarrier = OtcFormatHelper.FormatValue(value ?? 0, 6); } } } /// /// 期初价格 /// private double? _spotPrice; public double? SpotPrice { get { return _spotPrice; } set { if (PS.Config.Company== Configuration.CompanyEnum.国投) { _spotPrice = OtcFormatHelper.FormatValue(value ?? 0, 2); } else { _spotPrice = OtcFormatHelper.FormatValue(value ?? 0, 6); } } } private string _premiumRate; /// /// 期权费率 /// public string PremiumRate { get => _premiumRate; set => _premiumRate = value; } private string _principalRate; /// /// 保底比例 /// public string PrincipalRate { get => _principalRate; set => _principalRate = value; } private double? _initialMargin; /// /// 期初预付金 /// public double? InitialMargin { get => _initialMargin; set => _initialMargin = OtcFormatHelper.FormatValue(value ?? 0, 6); } private double? _positionMargin; /// /// 持仓预付金 /// public double? PositionMargin { get => _positionMargin; set => _positionMargin = OtcFormatHelper.FormatValue(value ?? 0, 6); } private string _riskYield; /// /// 风险中性收益率 /// public string RiskYield { get => _riskYield; set => _riskYield = value; } private double? _coupon; /// /// 红利票息率 /// public double? Coupon { get => _coupon; set => _coupon = OtcFormatHelper.FormatValue(value ?? 0, 6); } private double? _koCoupon; /// /// 敲出票息率 /// public double? KOCoupon { get => _koCoupon; set => _koCoupon = OtcFormatHelper.FormatValue(value ?? 0, 6); } private string _kiPayoffType; /// /// 敲入期权类型 /// public string KIPayoffType { get => _kiPayoffType; set => _kiPayoffType = value; } private string _remark; /// /// 备注 /// public string Remark { get => _remark; set => _remark = value; } #endregion } }