using YLErp.DBModels; namespace YLErp.Models { /// /// 日终价格类 /// public class EodPrice { /// /// 是否股票 /// public bool IsStock { get; set; } /// /// 取值日 /// public DateTime ValueDate { get; set; } /// /// 标的ID /// public int UnderlyingId { get; set; } /// /// 标的代码 /// public string UnderlyingCode { get; set; } /// /// 收盘价 /// public double ClosePrice { get; set; } /// /// 结算价 /// public double SettlePrice { get; set; } /// /// 参考价 /// public double? ReferencePrice { get; set; } /// /// 最高价 /// public double? HighPrice { get; set; } /// /// 最低价 /// public double? LowPrice { get; set; } /// /// 运行状态 /// public string UnderlyingStatus { get; set; } public decimal? DeciSettlePrice { get; set; } public decimal? DeciClosePrice { get; set; } public decimal? DeciReferencePrice { get; set; } public decimal? Vobp { get; set; } public string UnderlyingInstrumentType { get; set; } public EodPrice Clone() { return (EodPrice)MemberwiseClone(); } public override string ToString() { return $"{ValueDate}--{UnderlyingId}--{UnderlyingCode}--{ClosePrice}"; } /// /// /// public double GetPrice(SettlementTypeEnum type) { switch (type) { default: case SettlementTypeEnum.ClosePrice: return ClosePrice; case SettlementTypeEnum.ReferencePrice: return ReferencePrice ?? 0; case SettlementTypeEnum.SettlePrice: return IsStock ? ClosePrice : SettlePrice; } } } }