using System.ComponentModel.DataAnnotations.Schema;
namespace YLErp.DBModels
{
public class EodPnl : DBModelWithOperator
{
/////
///// 簿记账户信息
/////
//[DisplayName("簿记账户信息")]
//[Required]
//public int BookId { get; set; }
///
/// 估值日
///
[DisplayName("估值日")]
public DateTime ValueDate { get; set; }
///
/// 交易信息
///
[DisplayName("交易信息")]
public int TradeId { get; set; }
/////
///// 资产代码
/////
//[DisplayName("资产代码")]
//public string AssetCode { get; set; }
/////
///// 持仓类型
/////
//[DisplayName("持仓类型")]
//public string PositionType { get; set; }
/////
///// 结构类型
/////
//[DisplayName("结构类型")]
//public string TradeType { get; set; }
/////
///// 份额
/////
//[DisplayName("份额")]
//public double Notional { get; set; }
/////
///// 昨日价值
/////
//[DisplayName("昨日价值")]
//public double LastPv { get; set; }
/////
///// PV
/////
//public double Pv { get => _pv; set => _pv = NumberHelper.Normalize(value); }
/////
///// 四舍五入处理后的持仓市值
/////
//public double RoundedPv { get => _roundedPv; set => _roundedPv = NumberHelper.Normalize(value); }
/////
///// 当日价值
/////
//[DisplayName("当日价值")]
//public double DailyPnL { get => _dailyPnL; set => _dailyPnL = NumberHelper.Normalize(value); }
/////
///// 总盈亏
/////
//[DisplayName("总盈亏")]
//public double TotalPnL { get => _totalPnL; set => _totalPnL = NumberHelper.Normalize(value); }
/////
///// 持仓盈亏
/////
//[DisplayName("持仓盈亏")]
//public double PositionPnl { get => _positionPnl; set => _positionPnl = NumberHelper.Normalize(value); }
/////
///// 四舍五入处理后的持仓盈亏
/////
//[DisplayName("持仓盈亏")]
//public double RoundedPositionPnl { get => _roundedPositionPnl; set => _roundedPositionPnl = NumberHelper.Normalize(value); }
/////
///// RealizedPnL
/////
//[DisplayName("RealizedPnL")]
//public double RealizedPnL { get => realizedPnL; set => realizedPnL = NumberHelper.Normalize(value); }
///
///
///
[DisplayName("PnLPrice")]
public double PnLPrice { get; set; }
///
///
///
[DisplayName("PnLDelta")]
public double PnLDelta { get; set; }
///
///
///
[DisplayName("PnLGamma")]
public double PnLGamma { get; set; }
///
///
///
[DisplayName("PnLVega")]
public double PnLVega { get; set; }
///
///
///
[DisplayName("PnLTheta")]
public double PnLTheta { get; set; }
///
///
///
[DisplayName("PnLRho")]
public double PnLRho { get; set; }
///
/// Psi 为分红率(q)的变化所产生的 PnL
///
public double PnLPsi { get; set; }
///
///
///
[DisplayName("PnLPriceResidual")]
public double PnLPriceResidual { get; set; }
///
///
///
[DisplayName("PnLVolResidual")]
public double PnLVolResidual { get; set; }
///
///
///
[DisplayName("PnLPriceVolCross")]
public double PnLPriceVolCross { get; set; }
///
///
///
[DisplayName("PnLVol")]
public double PnLVol { get; set; }
///
/// 未归因盈亏
///
[DisplayName("未归因盈亏")]
public double UnexplainedPnL { get; set; }
///
/// 已归因盈亏
///
[DisplayName("已归因盈亏")]
public double ExplainedPnL { get; set; }
/////
///// 交易编号(准备删除)
/////
//[DisplayName("交易编号")]
//public string TradeNumber { get; set; }
///
/// 对冲交易唯一编码
///
[DisplayName("对冲交易唯一编码")]
public string HedgeUniqueCode { get; set; }
/////
///// 标的ID
/////
//[DisplayName("标的ID")]
//public int UnderlyingId { get; set; }
/////
///// 标的代码
/////
//[DisplayName("标的代码")]
//public string UnderlyingCode { get; set; }
/////
///// 成本
/////
//[DisplayName("标的代码")]
//public double Cost { get; set; }
/////
///// 手续费
/////
//[DisplayName("手续费")]
//public double Commission { get; set; }
/////
///// 场内期权合约号
/////
//[DisplayName("场内期权合约号")]
//public string ExchangeOptionCode { get; set; }
public override string ToString()
{
var tid = TradeId > 0 ? TradeId.ToString() : HedgeUniqueCode;
return $"{ValueDate:yyyy-MM-dd},{tid}";
}
public EodPnl Clone()
{
return (EodPnl)MemberwiseClone();
}
}
[Table("eod_pnl")]
public class eod_pnl : EodPnl
{
}
[Table("eod_pnl_hedgevol")]
public class eod_pnl_hedgevol : EodPnl
{
}
[Table("eod_pnl_extend")]
public class eod_pnl_extend : EodPnl
{
}
[Table("eod_pnl_extend_s")]
public class eod_pnl_extend_s : EodPnl
{
}
[Table("eod_pnl_openvol")]
public class eod_pnl_openvol : EodPnl
{
}
[Table("eod_pnl_s")]
public class eod_pnl_s : EodPnl
{
}
[Table("eod_pnl_hedgevol_s")]
public class eod_pnl_hedgevol_s : EodPnl
{
}
[Table("eod_pnl_openvol_s")]
public class eod_pnl_openvol_s : EodPnl
{
}
}