Files
zszq-trs/YLErpDAL/Model/HedgingMonitor.cs
T
2024-05-09 14:06:26 +08:00

151 lines
4.2 KiB
C#

using BaseOUDAL;
namespace YLErp.Model
{
public class HedgingMonitor
{
/// <summary>
/// 挂钩标的
/// </summary>
public string UnderlyingCode { get; set; }
/// <summary>
/// 交易代码
/// </summary>
public string TradeCode { get; set; }
/// <summary>
/// 交易类型
/// </summary>
public string TradeType { get; set; }
/// <summary>
/// 持仓数量
/// </summary>
public double PositionNotional { get; set; }
/// <summary>
/// 最新价格
/// </summary>
public double? Price { get; set; }
/// <summary>
/// 持仓市值
/// </summary>
public double Pv { get; set; }
/// <summary>
/// 今日成交总额(净值)
/// </summary>
public double TradePrice { get; set; }
/// <summary>
/// 今日成交总额(买入)
/// </summary>
public double BuyTradePrice { get; set; }
/// <summary>
/// 今日成交总额(卖出)
/// </summary>
public double SellTradePrice { get; set; }
/// <summary>
/// 今日市场成交总额
/// </summary>
public double MarketTradePrice { get; set; }
/// <summary>
/// 成交量占比
/// </summary>
public double NotionalRate { get; set; }
/// <summary>
/// 今日买入数量
/// </summary>
public double BuyNotional { get; set; }
/// <summary>
/// 今日买入最低价
/// </summary>
public double BuyLowPrice { get; set; }
/// <summary>
/// 今日买入均价
/// </summary>
public double BuyAvgPrice { get; set; }
/// <summary>
/// 今日卖出数量
/// </summary>
public double SellNotional { get; set; }
/// <summary>
/// 今日卖出最高价
/// </summary>
public double SellHighPrice { get; set; }
/// <summary>
/// 今日卖出最低价
/// </summary>
public double SellLowPrice { get; set; }
/// <summary>
/// 今日卖出均价
/// </summary>
public double SellAvgPrice { get; set; }
public int CountRatio { get; set; }
}
public class HedgingMonitorReq : BaseSearchReq
{
/// <summary>
/// 结算日期
/// </summary>
public DateTime SettlementDate { get; set; }
/// <summary>
/// 标的品种
/// </summary>
public List<int> VarietyIds { get; set; }
/// <summary>
/// 标的代码
/// </summary>
public List<int> UnderlyingIds { get; set; }
}
public class SearchHedgingMonitorResult : SearchListResult<HedgingMonitor>
{
/// <summary>
/// 汇总行
/// </summary>
public HedgingMonitor userdata { get; private set; }
public void SetUserData()
{
this.userdata = new HedgingMonitor()
{
UnderlyingCode = "合计",
TradeCode = "合计",
PositionNotional = rows.Sum(O => O.PositionNotional).OtcFormatValue(OtcFormatFlag.notional),
Pv = Commons.OtcFormatHelper.GetTradePriceDouble(rows.Sum(O => O.Pv)),
TradePrice = Commons.OtcFormatHelper.GetTradePriceDouble(rows.Sum(O => O.TradePrice)),
MarketTradePrice = Commons.OtcFormatHelper.GetTradePriceDouble(rows.Sum(O => O.MarketTradePrice)),
BuyTradePrice = double.NaN,
SellTradePrice = double.NaN,
Price = double.NaN,
TradeType = "",
NotionalRate = double.NaN,
BuyNotional = rows.Sum(O => O.BuyNotional).OtcFormatValue(OtcFormatFlag.notional),
BuyLowPrice = double.NaN,
BuyAvgPrice = double.NaN,
SellNotional = rows.Sum(O => O.SellNotional).OtcFormatValue(OtcFormatFlag.notional),
SellHighPrice = double.NaN,
SellLowPrice = double.NaN,
SellAvgPrice = double.NaN
};
}
}
}