MemberPosition.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. using Muchinfo.MTPClient.Data.Helper;
  2. using Muchinfo.MTPClient.Resources;
  3. namespace Muchinfo.MTPClient.Data.Model.Account
  4. {
  5. public class MemberPosition : OrderBase
  6. {
  7. /// <summary>
  8. /// 客户买浮动盈亏
  9. /// </summary>
  10. public decimal BuyFloatPL { get; set; }
  11. /// <summary>
  12. ///会员买浮动盈亏
  13. /// </summary>
  14. public decimal MemberBuyFloatPL { get; set; }
  15. /// <summary>
  16. ///会员卖浮动盈亏
  17. /// </summary>
  18. public decimal MemberSellFloatPL { get; set; }
  19. /// <summary>
  20. /// 客户买数量
  21. /// </summary>
  22. public decimal BuyHolderQty { get; set; }
  23. /// <summary>
  24. /// 客户净盈亏
  25. /// </summary>
  26. public decimal CustomerFloatPL
  27. {
  28. get { return BuyFloatPL + SellFloatPL; }
  29. }
  30. /// <summary>
  31. /// 客户净头寸
  32. /// </summary>
  33. public decimal CustomerNetQty
  34. {
  35. get { return BuyHolderQty - SellHolderQty; }
  36. }
  37. /// <summary>
  38. /// 会员净盈亏
  39. /// </summary>
  40. public decimal MemberFloatPL {
  41. get
  42. {
  43. return MemberBuyFloatPL + MemberSellFloatPL;
  44. } }
  45. /// <summary>
  46. /// 会员净头寸
  47. /// </summary>
  48. public decimal MemberNetQty
  49. {
  50. get { return MemberBuyHolderQty - MemberSellHolderQty; }
  51. }
  52. /// <summary>
  53. /// 会员买数量
  54. /// </summary>
  55. public decimal MemberBuyHolderQty { get; set; }
  56. /// <summary>
  57. /// 会员卖数量
  58. /// </summary>
  59. public decimal MemberSellHolderQty { get; set; }
  60. /// <summary>
  61. /// 客户卖浮动盈亏
  62. /// </summary>
  63. public decimal SellFloatPL { get; set; }
  64. /// <summary>
  65. /// 客户卖数量
  66. /// </summary>
  67. public decimal SellHolderQty { get; set; }
  68. /// <summary>
  69. /// 客户卖浮动盈亏格式化
  70. /// </summary>
  71. public string SellFloatPLDisplay
  72. {
  73. get
  74. {
  75. return SellFloatPL.ToString(PriceFormat);
  76. }
  77. }
  78. /// <summary>
  79. /// 客户买浮动盈亏格式化
  80. /// </summary>
  81. public string BuyFloatPLDisplay
  82. {
  83. get
  84. {
  85. return BuyFloatPL.ToString(PriceFormat);
  86. }
  87. }
  88. /// <summary>
  89. /// 客户净盈亏格式化
  90. /// </summary>
  91. public string CustomerFloatPLDisplay
  92. {
  93. get
  94. {
  95. return CustomerFloatPL.ToString("f2");//[固定保留两位小数]
  96. }
  97. }
  98. /// <summary>
  99. /// 会员净盈亏格式化
  100. /// </summary>
  101. public string MemberFloatPLDisplay
  102. {
  103. get
  104. {
  105. return MemberFloatPL.ToString("f2");//[固定保留两位小数]
  106. }
  107. }
  108. /// <summary>
  109. /// 会员净盈亏汇总
  110. /// </summary>
  111. public string SumMemberNetFloatPLDisplay
  112. {
  113. get
  114. {
  115. return (CustomerFloatPL + MemberFloatPL).ToString("f2");//[固定保留两位小数]
  116. }
  117. }
  118. /// <summary>
  119. /// 会员净头寸汇总
  120. /// </summary>
  121. public string SumMemberNetLotDisplay
  122. {
  123. get
  124. {
  125. return (MemberNetQty - CustomerNetQty).ToString();
  126. }
  127. }
  128. /// <summary>
  129. /// 价格格式化
  130. /// </summary>
  131. //public string PriceFormat
  132. //{
  133. // get
  134. // {
  135. // return "F2";
  136. // //if (this.QuoteGoods != null)
  137. // //{
  138. // // return QuoteGoods.FormatPrice;
  139. // //}
  140. // //else
  141. // //{
  142. // // return "F0";
  143. // //}
  144. // }
  145. //}
  146. /// <summary>
  147. /// 可平数量
  148. /// </summary>
  149. public string CloseQtyDisplay {
  150. get
  151. {
  152. return string.Format(Client_Resource.Position_CloseBidAskQty,
  153. CloseBidQty<= 0 ? "-" : CloseBidQty + string.Empty,
  154. CloseAskQty <= 0 ? "-" : CloseAskQty + string.Empty);
  155. } }
  156. /// <summary>
  157. /// 可以平买数量
  158. /// </summary>
  159. public decimal CloseBidQty { get; set; }
  160. /// <summary>
  161. /// 可以平卖数量
  162. /// </summary>
  163. public decimal CloseAskQty { get; set; }
  164. /// <summary>
  165. /// 头寸类型
  166. /// </summary>
  167. public string FPLTypeString
  168. {
  169. get
  170. {
  171. return FPLType.Discription();
  172. //switch (FPLType)
  173. //{
  174. // case FPLType.Member:
  175. // return "会员";
  176. // case FPLType.MemberBid:
  177. // return "会员-竞价";
  178. // case FPLType.Customer:
  179. // return "投资者";
  180. // case FPLType.None:
  181. // return "--";
  182. // break;
  183. // default:
  184. // return "--";
  185. // break;
  186. //}
  187. }
  188. }
  189. /// <summary>
  190. /// 头寸类型
  191. /// </summary>
  192. public FPLType FPLType { get; set; }
  193. }
  194. //暂时添加头寸类型动盈亏类型 01: 客户端-会员竞价头寸浮动盈亏, 02: 客户端-客户头寸浮动盈亏, 03: 客户端-自营头寸浮动盈亏
  195. public enum FPLType
  196. {
  197. /// <summary>
  198. /// 无
  199. /// </summary>
  200. [ItemDisc("Domain_No")]
  201. None = 0,
  202. //客户端-会员竞价头寸浮动盈亏
  203. [ItemDisc("Domain_MembBid")]
  204. MemberBid = 1,
  205. /// <summary>
  206. /// 投资者
  207. /// </summary>
  208. [ItemDisc("Domain_Investor")]
  209. Customer = 2,
  210. /// <summary>
  211. /// 会员
  212. /// </summary>
  213. [ItemDisc("Domain_Memb")]
  214. Member = 3,
  215. }
  216. }