130 lines
3.3 KiB
C#
130 lines
3.3 KiB
C#
namespace YLErp.Modules.VolatilityModule
|
|
{
|
|
/// <summary>
|
|
/// 波动率取值请求
|
|
/// </summary>
|
|
public class SingleVolReq
|
|
{
|
|
public SingleVolReq()
|
|
{
|
|
|
|
}
|
|
|
|
public SingleVolReq(OtcTrade trade, underlying_manager udm)
|
|
{
|
|
if (trade is null)
|
|
{
|
|
throw new ArgumentNullException(nameof(trade));
|
|
}
|
|
|
|
if (udm is null)
|
|
{
|
|
throw new ArgumentNullException(nameof(udm));
|
|
}
|
|
|
|
VolType = trade.VolType;
|
|
Strike = trade.Strike ?? 0;
|
|
SpotPrice = trade.SpotPrice ?? 0;
|
|
TradeDate = trade.TradeDate.Value;
|
|
ExerciseDate = trade.ExerciseDate.Value;
|
|
IsMoneynessOption = trade.IsMoneynessOption;
|
|
CallPut = trade.CallPut;
|
|
|
|
UnderlyingId = udm.id;
|
|
UnderlyingCode = udm.UnderlyingCode;
|
|
UnderlyingName = udm.UnderlyingName;
|
|
UnderlyingTypeId = udm.UnderlyingTypeId;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 取波动率时宏源这样的多团队需要赋值此字段
|
|
/// </summary>
|
|
public string UserGroup { get; set; }
|
|
|
|
//--------------------------------------
|
|
// trade
|
|
//--------------------------------------
|
|
|
|
public string VolType { get; set; }
|
|
|
|
/// <summary>
|
|
/// 行权价
|
|
/// </summary>
|
|
public double Strike { get; set; }
|
|
|
|
/// <summary>
|
|
/// 标的价格
|
|
/// </summary>
|
|
public double SpotPrice { get; set; }
|
|
|
|
/// <summary>
|
|
/// 成交日(波动率的日期取这个日期)
|
|
/// </summary>
|
|
public DateTime TradeDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// 行权日
|
|
/// </summary>
|
|
public DateTime ExerciseDate { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否相对行权价(是|其它值)
|
|
/// </summary>
|
|
public string IsMoneynessOption { get; set; }
|
|
|
|
/// <summary>
|
|
/// [skew]CallPut
|
|
/// </summary>
|
|
public string CallPut { get; set; }
|
|
|
|
//--------------------------------------
|
|
// underlying
|
|
//--------------------------------------
|
|
|
|
/// <summary>
|
|
/// 标的ID
|
|
/// </summary>
|
|
public int UnderlyingId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 标的代码
|
|
/// </summary>
|
|
public string UnderlyingCode { get; set; }
|
|
|
|
/// <summary>
|
|
/// 标的名称
|
|
/// </summary>
|
|
public string UnderlyingName { get; set; }
|
|
|
|
/// <summary>
|
|
/// [skew]品种ID
|
|
/// </summary>
|
|
public int UnderlyingTypeId { get; set; }
|
|
|
|
//--------------------------------------
|
|
// skew
|
|
//--------------------------------------
|
|
|
|
/// <summary>
|
|
/// [skew]BaseVol
|
|
/// </summary>
|
|
public double? BaseVol { get; set; }
|
|
|
|
/// <summary>
|
|
/// [skew]BidVar
|
|
/// </summary>
|
|
public int? BidVar { get; set; }
|
|
|
|
/// <summary>
|
|
/// [skew]AskVar
|
|
/// </summary>
|
|
public int? AskVar { get; set; }
|
|
|
|
//--------------------------------------
|
|
// vols
|
|
//--------------------------------------
|
|
|
|
public Abstract.IVolatility Vols { get; set; }
|
|
}
|
|
}
|