| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- using Muchinfo.MTPClient.Data.Helper;
- using Muchinfo.MTPClient.Resources;
- namespace Muchinfo.MTPClient.Data.Model.Account
- {
- public class MemberPosition : OrderBase
- {
- /// <summary>
- /// 客户买浮动盈亏
- /// </summary>
- public decimal BuyFloatPL { get; set; }
- /// <summary>
- ///会员买浮动盈亏
- /// </summary>
- public decimal MemberBuyFloatPL { get; set; }
- /// <summary>
- ///会员卖浮动盈亏
- /// </summary>
- public decimal MemberSellFloatPL { get; set; }
- /// <summary>
- /// 客户买数量
- /// </summary>
- public decimal BuyHolderQty { get; set; }
- /// <summary>
- /// 客户净盈亏
- /// </summary>
- public decimal CustomerFloatPL
- {
- get { return BuyFloatPL + SellFloatPL; }
- }
- /// <summary>
- /// 客户净头寸
- /// </summary>
- public decimal CustomerNetQty
- {
- get { return BuyHolderQty - SellHolderQty; }
- }
-
- /// <summary>
- /// 会员净盈亏
- /// </summary>
- public decimal MemberFloatPL {
- get
- {
- return MemberBuyFloatPL + MemberSellFloatPL;
-
- } }
- /// <summary>
- /// 会员净头寸
- /// </summary>
- public decimal MemberNetQty
- {
- get { return MemberBuyHolderQty - MemberSellHolderQty; }
- }
- /// <summary>
- /// 会员买数量
- /// </summary>
- public decimal MemberBuyHolderQty { get; set; }
- /// <summary>
- /// 会员卖数量
- /// </summary>
- public decimal MemberSellHolderQty { get; set; }
- /// <summary>
- /// 客户卖浮动盈亏
- /// </summary>
- public decimal SellFloatPL { get; set; }
- /// <summary>
- /// 客户卖数量
- /// </summary>
- public decimal SellHolderQty { get; set; }
-
- /// <summary>
- /// 客户卖浮动盈亏格式化
- /// </summary>
- public string SellFloatPLDisplay
- {
- get
- {
- return SellFloatPL.ToString(PriceFormat);
- }
- }
- /// <summary>
- /// 客户买浮动盈亏格式化
- /// </summary>
- public string BuyFloatPLDisplay
- {
- get
- {
- return BuyFloatPL.ToString(PriceFormat);
- }
- }
- /// <summary>
- /// 客户净盈亏格式化
- /// </summary>
- public string CustomerFloatPLDisplay
- {
- get
- {
- return CustomerFloatPL.ToString("f2");//[固定保留两位小数]
- }
- }
- /// <summary>
- /// 会员净盈亏格式化
- /// </summary>
- public string MemberFloatPLDisplay
- {
- get
- {
- return MemberFloatPL.ToString("f2");//[固定保留两位小数]
- }
- }
- /// <summary>
- /// 会员净盈亏汇总
- /// </summary>
- public string SumMemberNetFloatPLDisplay
- {
- get
- {
- return (CustomerFloatPL + MemberFloatPL).ToString("f2");//[固定保留两位小数]
- }
- }
- /// <summary>
- /// 会员净头寸汇总
- /// </summary>
- public string SumMemberNetLotDisplay
- {
- get
- {
- return (MemberNetQty - CustomerNetQty).ToString();
- }
- }
- /// <summary>
- /// 价格格式化
- /// </summary>
- //public string PriceFormat
- //{
- // get
- // {
- // return "F2";
- // //if (this.QuoteGoods != null)
- // //{
- // // return QuoteGoods.FormatPrice;
- // //}
- // //else
- // //{
- // // return "F0";
- // //}
- // }
- //}
- /// <summary>
- /// 可平数量
- /// </summary>
- public string CloseQtyDisplay {
- get
- {
- return string.Format(Client_Resource.Position_CloseBidAskQty,
- CloseBidQty<= 0 ? "-" : CloseBidQty + string.Empty,
- CloseAskQty <= 0 ? "-" : CloseAskQty + string.Empty);
- } }
- /// <summary>
- /// 可以平买数量
- /// </summary>
- public decimal CloseBidQty { get; set; }
-
- /// <summary>
- /// 可以平卖数量
- /// </summary>
- public decimal CloseAskQty { get; set; }
-
- /// <summary>
- /// 头寸类型
- /// </summary>
- public string FPLTypeString
- {
- get
- {
- return FPLType.Discription();
- //switch (FPLType)
- //{
- // case FPLType.Member:
- // return "会员";
- // case FPLType.MemberBid:
- // return "会员-竞价";
- // case FPLType.Customer:
- // return "投资者";
- // case FPLType.None:
- // return "--";
- // break;
- // default:
- // return "--";
- // break;
- //}
- }
- }
- /// <summary>
- /// 头寸类型
- /// </summary>
- public FPLType FPLType { get; set; }
- }
- //暂时添加头寸类型动盈亏类型 01: 客户端-会员竞价头寸浮动盈亏, 02: 客户端-客户头寸浮动盈亏, 03: 客户端-自营头寸浮动盈亏
- public enum FPLType
- {
- /// <summary>
- /// 无
- /// </summary>
- [ItemDisc("Domain_No")]
- None = 0,
- //客户端-会员竞价头寸浮动盈亏
- [ItemDisc("Domain_MembBid")]
- MemberBid = 1,
- /// <summary>
- /// 投资者
- /// </summary>
- [ItemDisc("Domain_Investor")]
- Customer = 2,
- /// <summary>
- /// 会员
- /// </summary>
- [ItemDisc("Domain_Memb")]
- Member = 3,
- }
- }
|