TradePosition.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Muchinfo.MTPClient.Data.Helper;
  6. namespace Muchinfo.MTPClient.Data.Model.Account
  7. {
  8. public class TradePosition : OrderBase
  9. {
  10. [PropertyDisc("accountid")]
  11. public long accountid { get; set; }
  12. [PropertyDisc("accountname")]
  13. public string accountname { get; set; }
  14. [PropertyDisc("reckondate")]
  15. public string reckondate { get; set; }
  16. [PropertyDisc("agreeunit")]
  17. public decimal agreeunit { get; set; }
  18. [PropertyDisc("decimalplace")]
  19. public decimal decimalplace { get; set; }
  20. [PropertyDisc("buypositionqty")]
  21. public decimal buypositionqty { get; set; }
  22. [PropertyDisc("buyholderamount")]
  23. public decimal buyholderamount { get; set; }
  24. [PropertyDisc("buycurpositionqty")]
  25. public decimal buycurpositionqty { get; set; }
  26. [PropertyDisc("buycurholderamount")]
  27. public decimal buycurholderamount { get; set; }
  28. [PropertyDisc("buyfrozenqty")]
  29. public decimal buyfrozenqty { get; set; }
  30. [PropertyDisc("buyotherfrozenqty")]
  31. public decimal buyotherfrozenqty { get; set; }
  32. [PropertyDisc("buyopenreqqty")]
  33. public decimal buyopenreqqty { get; set; }
  34. [PropertyDisc("buyreckonpl")]
  35. public decimal buyreckonpl { get; set; }
  36. [PropertyDisc("buyinterest")]
  37. public decimal buyinterest { get; set; }
  38. [PropertyDisc("buyusedmargin")]
  39. public decimal buyusedmargin { get; set; }
  40. [PropertyDisc("buyopentotalqty")]
  41. public decimal buyopentotalqty { get; set; }
  42. [PropertyDisc("buyclosetotalqty")]
  43. public decimal buyclosetotalqty { get; set; }
  44. [PropertyDisc("buyclosetotalpl")]
  45. public decimal buyclosetotalpl { get; set; }
  46. [PropertyDisc("sellpositionqty")]
  47. public decimal sellpositionqty { get; set; }
  48. [PropertyDisc("sellholderamount")]
  49. public decimal sellholderamount { get; set; }
  50. [PropertyDisc("sellcurpositionqty")]
  51. public decimal sellcurpositionqty { get; set; }
  52. [PropertyDisc("sellcurholderamount")]
  53. public decimal sellcurholderamount { get; set; }
  54. [PropertyDisc("sellfrozenqty")]
  55. public decimal sellfrozenqty { get; set; }
  56. [PropertyDisc("sellotherfrozenqty")]
  57. public decimal sellotherfrozenqty { get; set; }
  58. [PropertyDisc("sellopenreqqty")]
  59. public decimal sellopenreqqty { get; set; }
  60. [PropertyDisc("sellreckonpl")]
  61. public decimal sellreckonpl { get; set; }
  62. [PropertyDisc("sellinterest")]
  63. public decimal sellinterest { get; set; }
  64. [PropertyDisc("sellusedmargin")]
  65. public decimal sellusedmargin { get; set; }
  66. [PropertyDisc("sellopentotalqty")]
  67. public decimal sellopentotalqty { get; set; }
  68. [PropertyDisc("sellclosetotalqty")]
  69. public decimal sellclosetotalqty { get; set; }
  70. [PropertyDisc("sellclosetotalpl")]
  71. public decimal sellclosetotalpl { get; set; }
  72. [PropertyDisc("tradeproperty")]
  73. public decimal tradeproperty { get; set; }
  74. [PropertyDisc("interest2")]
  75. public decimal interest2 { get; set; }
  76. [PropertyDisc("accountcurrencyid")]
  77. public decimal accountcurrencyid { get; set; }
  78. [PropertyDisc("goodscurrencyid")]
  79. public decimal goodscurrencyid { get; set; }
  80. [PropertyDisc("curexchangerate")]
  81. public decimal curexchangerate { get; set; }
  82. [PropertyDisc("buyreckonpl2")]
  83. public decimal buyreckonpl2 { get; set; }
  84. [PropertyDisc("sellreckonpl2")]
  85. public decimal sellreckonpl2 { get; set; }
  86. [PropertyDisc("trademode")]
  87. public int trademode { get; set; }
  88. [PropertyDisc("marketname")]
  89. public string marketname { get; set; }
  90. public string BuyAvgPriceDisplay
  91. {
  92. get
  93. {
  94. if (buycurpositionqty == 0) return "-";
  95. return (buycurholderamount/buycurpositionqty).ToString(PriceExpFormat);
  96. }
  97. }
  98. public string SellAvgPriceDisplay
  99. {
  100. get
  101. {
  102. if (sellcurpositionqty == 0) return "-";
  103. return (sellcurholderamount / sellcurpositionqty).ToString(PriceExpFormat);
  104. }
  105. }
  106. /// <summary>
  107. /// Gets the hold total amount.
  108. /// </summary>
  109. /// <value>The hold total amount.</value>
  110. public string HoldTotalAmountDisplay
  111. {
  112. get { return (buycurholderamount + sellcurholderamount).ToString("N2"); }
  113. }
  114. /// <summary>
  115. /// Gets the reckon pl display.
  116. /// </summary>
  117. /// <value>The reckon pl display.</value>
  118. public string ReckonPLDisplay
  119. {
  120. get { return (buyreckonpl + sellreckonpl).ToString("N2"); }
  121. }
  122. public string ReckonPL2Display
  123. {
  124. get { return (buyreckonpl2 + sellreckonpl2).ToString("N2"); }
  125. }
  126. /// <summary>
  127. /// Gets the buy qty display.
  128. /// </summary>
  129. /// <value>The buy qty display.</value>
  130. public string BuyQtyDisplay
  131. {
  132. get
  133. {
  134. if (buycurpositionqty == 0) return "-";
  135. return (buycurpositionqty).ToString();
  136. }
  137. }
  138. /// <summary>
  139. /// Gets the sell qty display.
  140. /// </summary>
  141. /// <value>The sell qty display.</value>
  142. public string SellQtyDisplay
  143. {
  144. get
  145. {
  146. if (sellcurpositionqty == 0) return "-";
  147. return (sellcurpositionqty).ToString();
  148. }
  149. }
  150. }
  151. }