124 lines
3.9 KiB
C#
124 lines
3.9 KiB
C#
namespace YLErp.Modules.TQuoteModule
|
|
{
|
|
//-----------------------------------------
|
|
// ValueOption接口的请求和结果类
|
|
//-----------------------------------------
|
|
|
|
public class OptionValueRequest
|
|
{
|
|
public DateTime? ValueDate { get; set; }
|
|
public string UnderlyingCode { get; set; }
|
|
public DateTime MaturityDate { get; set; }
|
|
public string UnderlyingInstrumentType { get; set; }
|
|
public double Strike { get; set; }
|
|
public string OptionType { get; set; }
|
|
public string Exercise { get; set; }
|
|
public double SpotPrice { get; set; }
|
|
public double Notional { get; set; }
|
|
public double RiskFreeRate { get; set; }
|
|
public double Vol { get; set; }
|
|
public bool commodityFuturesPreciseTimeMode { get; set; } = true;
|
|
}
|
|
|
|
public class ClientOptionQuoteResult
|
|
{
|
|
public int StatusCode { get; set; }
|
|
|
|
public string Info { get; set; }
|
|
|
|
public double BuyQuote { get; set; }
|
|
public double BuyVol { get; set; }
|
|
public double BuyPv { get; set; }
|
|
public double BuyPercentageQuote { get; set; }
|
|
|
|
public double SellQuote { get; set; }
|
|
public double SellVol { get; set; }
|
|
public double SellPv { get; set; }
|
|
public double SellPercentageQuote { get; set; }
|
|
|
|
public double SellMargin { get; set; }
|
|
}
|
|
|
|
#region CustomizedQuote接口的请求和结果类
|
|
|
|
public class CustomizedQuoteRequest
|
|
{
|
|
public DateTime ValueDate { get; set; }
|
|
public string UnderlyingCode { get; set; }
|
|
public DateTime MaturityDate { get; set; }
|
|
public string UnderlyingInstrumentType { get; set; }
|
|
public double Strike { get; set; }
|
|
|
|
public string Exercise { get; set; }
|
|
public double SpotPrice { get; set; }
|
|
public double Notional { get; set; }
|
|
public double RiskFreeRate { get; set; }
|
|
public double BidVol { get; set; }
|
|
public double AskVol { get; set; }
|
|
public bool commodityFuturesPreciseTimeMode { get; set; } = true;
|
|
}
|
|
|
|
public class CustomizedQuoteResult
|
|
{
|
|
public int StatusCode { get; set; }
|
|
public string Info { get; set; }
|
|
public double CallAskPrice { get; set; }
|
|
public double CallBidPrice { get; set; }
|
|
public double Strike { get; set; }
|
|
public double PutAskPrice { get; set; }
|
|
public double PutBidPrice { get; set; }
|
|
public double BidVol { get; set; }
|
|
public double AskVol { get; set; }
|
|
public double LatestPrice { get; set; }
|
|
public double Change { get; set; }
|
|
public double ChangePercent { get; set; }
|
|
public double RiskFreeRate { get; set; }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region option策略代码报价结果类和解析类
|
|
public class StucturedQuoteResult
|
|
{
|
|
public double pv { get; set; }
|
|
}
|
|
public class OptionStrategyCodeParts
|
|
{
|
|
public int Notional { get; set; }
|
|
public string UnderlyingCode { get; set; }
|
|
public string OptionType { get; set; }
|
|
public string Maturity { get; set; }
|
|
public double Strike { get; set; }
|
|
public bool IsSell { get; set; }
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Format(
|
|
"{0}{1}{2}{3}{4}{5}",
|
|
IsSell ? "-" : "",
|
|
Notional == 1 ? "" : string.Format("{0}*", Notional),
|
|
UnderlyingCode,
|
|
"Call".Equals(OptionType) ? "C" : "P",
|
|
Maturity,
|
|
Strike);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 日期字符串的Json封装
|
|
public class DateResult
|
|
{
|
|
public string Date { get; set; }
|
|
}
|
|
|
|
public class DateListResult
|
|
{
|
|
public List<string> DateList { get; set; }
|
|
}
|
|
#endregion
|
|
|
|
public class LatestPricesResult
|
|
{
|
|
public Dictionary<string, double> Data { get; set; }
|
|
}
|
|
} |