194 lines
5.3 KiB
C#
194 lines
5.3 KiB
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
using YLErp.DBModels.Attributes;
|
|
using YLErp.Helpers;
|
|
|
|
namespace YLErp.DBModels
|
|
{
|
|
[DataChange]
|
|
[Table("trade_autocall")]
|
|
public class trade_autocall : TradeExtendBase, IClonable<trade_autocall>, IDataTraceV2, IDataTraceV3
|
|
{
|
|
private string _couponDayCount;
|
|
|
|
[DisplayName("敲入敲出状态")]
|
|
public string KnockInOutStatus { get; set; }
|
|
|
|
[NotMapped]
|
|
[DisplayName("敲入敲出状态")]
|
|
public string KnockInOutStatusCn => Helpers.TradeHelper.GetKnockInOutStatusCn(KnockInOutStatus);
|
|
|
|
[DisplayName("敲入敲出日期")]
|
|
public DateTime? KnockInOutDate { get; set; }
|
|
|
|
[DisplayName("敲出价格")]
|
|
[TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public double KOBarrier { set; get; }
|
|
|
|
[DisplayName("期权敲入价格")]
|
|
[TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public double KIBarrier { set; get; }
|
|
|
|
[DisplayName("派息障碍价格")]
|
|
[TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public double CouponBarrier { get; set; }
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[DisplayName("票息")]
|
|
[TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public double Coupon { get; set; }
|
|
|
|
[DisplayName("票息是否年化")]
|
|
[TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public bool IsFixedCoupon { get; set; }
|
|
|
|
[DisplayName("票息结算方式")]
|
|
[TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public CouponPayTypeEnum CouponPayType { get; set; }
|
|
|
|
[DisplayName("敲入期权行权价1"), TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public double? SpreadStrike1 { get; set; }
|
|
|
|
/// <summary>
|
|
/// 封顶/封底行权价
|
|
/// </summary>
|
|
[DisplayName("封顶/封底行权价"), TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public double? SpreadStrike { get; set; }
|
|
|
|
/// <summary>
|
|
/// 票息是否期末支付
|
|
/// </summary>
|
|
public bool CouponPayAtMaturity => CouponPayType == CouponPayTypeEnum.AtMaturity;
|
|
|
|
[DisplayName("敲入未敲出仍支付票息 ")]
|
|
[TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public bool IncludeCouponAfterKI { get; set; }
|
|
|
|
[DisplayName("敲出观察日")]
|
|
public string KOObservationDates { get; set; }
|
|
/// <summary>
|
|
/// 票息观察信息
|
|
/// </summary>
|
|
[NotMapped]
|
|
public string CouponObservation { get; set;}
|
|
/// <summary>
|
|
/// 最近敲出观察日
|
|
/// </summary>
|
|
[NotMapped]
|
|
public DateTime? LatestKOObservationDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// 最近敲出障碍价格
|
|
/// </summary>
|
|
[NotMapped]
|
|
public double? LatestKOBarrier { get; set; }
|
|
|
|
[DisplayName("敲入观察日")]
|
|
public string ObservationDates { get; set; }
|
|
|
|
/// <summary>
|
|
/// 最近敲入观察日
|
|
/// </summary>
|
|
[NotMapped]
|
|
public DateTime? LatestObservationDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否为期权年化,默认false
|
|
/// </summary>
|
|
[DisplayName("期权年化")]
|
|
public bool IsAnnualized2 { get; set; }
|
|
|
|
[DisplayName("年化系数")]
|
|
public double? AnnualizeFactor2 { get; set; }
|
|
|
|
/// <summary>
|
|
/// 票息日历规则
|
|
/// Qdp.Pricing.Base.Enums.DayCount
|
|
/// </summary>
|
|
public string CouponDayCount
|
|
{
|
|
get => _couponDayCount ?? "Act365";
|
|
set => _couponDayCount = value;
|
|
}
|
|
|
|
public trade_autocall Clone()
|
|
{
|
|
return (trade_autocall)MemberwiseClone();
|
|
}
|
|
|
|
[NotMapped]
|
|
public List<autocall_observation> HappenedObservations { get; set; }
|
|
|
|
/// <summary>
|
|
/// 敲入到期支付类别
|
|
/// </summary>
|
|
[TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public KIPayoffTypeEnum KIPayoffType { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否首日计息
|
|
/// </summary>
|
|
[TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public bool? CouponIncludeStartDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否使用支付日期计息
|
|
/// </summary>
|
|
[TradeAuditChangeMsg]
|
|
[DataChange]
|
|
public bool? CouponUsePaymentDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// 敲入到期支付类别中文
|
|
/// </summary>
|
|
public string KIPayoffTypeDesc()
|
|
{
|
|
return KIPayoffTypeEnumHelper.GetDesc(KIPayoffType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 票息结算方式中文
|
|
/// </summary>
|
|
public string CouponPayTypeDesc()
|
|
{
|
|
return CouponPayTypeEnumHelper.GetDesc(CouponPayType);
|
|
}
|
|
|
|
public string GetDataTraceKeyId()
|
|
{
|
|
return TradeId.ToString();
|
|
}
|
|
|
|
public string GetDataTraceKeyInfo()
|
|
{
|
|
return "凤凰期权";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新敲入敲出状态时需要更新trade数据
|
|
/// </summary>
|
|
public string GetDataTraceTableName()
|
|
{
|
|
return ConsTrade.TableName;
|
|
}
|
|
}
|
|
|
|
[NotMapped]
|
|
public class trade_autocallDto : trade_autocall
|
|
{
|
|
|
|
}
|
|
}
|