Files
zszq-trs/YLErpDAL/Modules/SuperviseReportModule/CFMMC/Model/SuperviseReportPositionModel.cs
T
2024-05-09 14:06:26 +08:00

323 lines
8.3 KiB
C#

using Qdp.Pricing.Base.Utilities;
using YLErp.BLL;
using YLErp.Commons;
namespace YLErp.Modules.SuperviseReportModule.CFMMC.Model
{
public class SuperviseReportPositionModel : SuperviseReportBaseModel
{
/// <summary>
/// 持仓日期
/// </summary>
public DateTime? PositionDate { get; set; }
/// <summary>
/// 持仓日期
/// </summary>
public string PositionDateString
{
get
{
return PositionDate == null ? "" : PositionDate.Value.ToString("yyyy-MM-dd");
}
}
private double _vol;
/// <summary>
/// 估值波动率
/// </summary>
public double Vol
{
get { return _vol; }
set { _vol = OtcFormatHelper.FormatValue(value, 4); }
}
/// <summary>
/// 合约估值时标的价格
/// </summary>
public string InitialSpotPrice { get; set; }
private int _annualDays;
/// <summary>
/// 一年有效天数
/// </summary>
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;
/// <summary>
/// 无风险利率
/// </summary>
public double NoRiskRate
{
get { return _noRiskRate; }
set { _noRiskRate = OtcFormatHelper.FormatValue(value, 6); }
}
private double _discountRage;
/// <summary>
/// 贴现率
/// </summary>
public double DiscountRate
{
get { return _discountRage; }
set { _discountRage = OtcFormatHelper.FormatValue(value, 6); }
}
private double _gammaCash;
/// <summary>
/// GammaCash
/// </summary>
public double GammaCash
{
get => _gammaCash;
set => _gammaCash = value.OtcFormatValue(OtcFormatFlag.greek);
}
#region 雪球期权信息
private string _snowType;
/// <summary>
/// 雪球分类
/// </summary>
public string SnowType
{
get => _snowType;
set => _snowType = value;
}
private string _snowStatus;
/// <summary>
/// 雪球期权状态
/// </summary>
public string SnowStatus
{
get => _snowStatus;
set => _snowStatus = value;
}
private string _snowStructureInfo;
/// <summary>
/// 雪球结构要素
/// </summary>
public string SnowStructureInfo
{
get => _snowStructureInfo;
set => _snowStructureInfo = value;
}
private string _clientType;
/// <summary>
/// 交易对手类型
/// </summary>
public string ClientType
{
get => _clientType;
set => _clientType = value;
}
private string _koObservationDates;
/// <summary>
/// 敲出观察日期
/// </summary>
public string KOObservationDates
{
get => _koObservationDates;
set => _koObservationDates = value;
}
private string _koBarrier;
//敲出观察价格
public string KOBarrier
{
get => _koBarrier;
set => _koBarrier = value;
}
private string _kiObservationDates;
/// <summary>
/// 敲入观察日期
/// </summary>
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);
}
}
}
/// <summary>
/// 期初价格
/// </summary>
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;
/// <summary>
/// 期权费率
/// </summary>
public string PremiumRate
{
get => _premiumRate;
set => _premiumRate = value;
}
private string _principalRate;
/// <summary>
/// 保底比例
/// </summary>
public string PrincipalRate
{
get => _principalRate;
set => _principalRate = value;
}
private double? _initialMargin;
/// <summary>
/// 期初预付金
/// </summary>
public double? InitialMargin
{
get => _initialMargin;
set => _initialMargin = OtcFormatHelper.FormatValue(value ?? 0, 6);
}
private double? _positionMargin;
/// <summary>
/// 持仓预付金
/// </summary>
public double? PositionMargin
{
get => _positionMargin;
set => _positionMargin = OtcFormatHelper.FormatValue(value ?? 0, 6);
}
private string _riskYield;
/// <summary>
/// 风险中性收益率
/// </summary>
public string RiskYield
{
get => _riskYield;
set => _riskYield = value;
}
private double? _coupon;
/// <summary>
/// 红利票息率
/// </summary>
public double? Coupon
{
get => _coupon;
set => _coupon = OtcFormatHelper.FormatValue(value ?? 0, 6);
}
private double? _koCoupon;
/// <summary>
/// 敲出票息率
/// </summary>
public double? KOCoupon
{
get => _koCoupon;
set => _koCoupon = OtcFormatHelper.FormatValue(value ?? 0, 6);
}
private string _kiPayoffType;
/// <summary>
/// 敲入期权类型
/// </summary>
public string KIPayoffType
{
get => _kiPayoffType;
set => _kiPayoffType = value;
}
private string _remark;
/// <summary>
/// 备注
/// </summary>
public string Remark
{
get => _remark;
set => _remark = value;
}
#endregion
}
}