94 lines
2.3 KiB
C#
94 lines
2.3 KiB
C#
using YLErp.DBModels;
|
|
|
|
namespace YLErp.Models
|
|
{
|
|
/// <summary>
|
|
/// 日终价格类
|
|
/// </summary>
|
|
public class EodPrice
|
|
{
|
|
/// <summary>
|
|
/// 是否股票
|
|
/// </summary>
|
|
public bool IsStock { get; set; }
|
|
|
|
/// <summary>
|
|
/// 取值日
|
|
/// </summary>
|
|
public DateTime ValueDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// 标的ID
|
|
/// </summary>
|
|
public int UnderlyingId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 标的代码
|
|
/// </summary>
|
|
public string UnderlyingCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// 收盘价
|
|
/// </summary>
|
|
public double ClosePrice { get; set; }
|
|
|
|
/// <summary>
|
|
/// 结算价
|
|
/// </summary>
|
|
public double SettlePrice { get; set; }
|
|
|
|
/// <summary>
|
|
/// 参考价
|
|
/// </summary>
|
|
public double? ReferencePrice { get; set; }
|
|
|
|
/// <summary>
|
|
/// 最高价
|
|
/// </summary>
|
|
public double? HighPrice { get; set; }
|
|
|
|
/// <summary>
|
|
/// 最低价
|
|
/// </summary>
|
|
public double? LowPrice { get; set; }
|
|
|
|
/// <summary>
|
|
/// 运行状态
|
|
/// </summary>
|
|
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}";
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
}
|