| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Muchinfo.MTPClient.Data.Helper;
- namespace Muchinfo.MTPClient.Data.Model.Account
- {
- public class TradePosition : OrderBase
- {
- [PropertyDisc("accountid")]
- public long accountid { get; set; }
- [PropertyDisc("accountname")]
- public string accountname { get; set; }
- [PropertyDisc("reckondate")]
- public string reckondate { get; set; }
- [PropertyDisc("agreeunit")]
- public decimal agreeunit { get; set; }
- [PropertyDisc("decimalplace")]
- public decimal decimalplace { get; set; }
- [PropertyDisc("buypositionqty")]
- public decimal buypositionqty { get; set; }
- [PropertyDisc("buyholderamount")]
- public decimal buyholderamount { get; set; }
- [PropertyDisc("buycurpositionqty")]
- public decimal buycurpositionqty { get; set; }
- [PropertyDisc("buycurholderamount")]
- public decimal buycurholderamount { get; set; }
- [PropertyDisc("buyfrozenqty")]
- public decimal buyfrozenqty { get; set; }
- [PropertyDisc("buyotherfrozenqty")]
- public decimal buyotherfrozenqty { get; set; }
- [PropertyDisc("buyopenreqqty")]
- public decimal buyopenreqqty { get; set; }
- [PropertyDisc("buyreckonpl")]
- public decimal buyreckonpl { get; set; }
- [PropertyDisc("buyinterest")]
- public decimal buyinterest { get; set; }
- [PropertyDisc("buyusedmargin")]
- public decimal buyusedmargin { get; set; }
- [PropertyDisc("buyopentotalqty")]
- public decimal buyopentotalqty { get; set; }
- [PropertyDisc("buyclosetotalqty")]
- public decimal buyclosetotalqty { get; set; }
- [PropertyDisc("buyclosetotalpl")]
- public decimal buyclosetotalpl { get; set; }
- [PropertyDisc("sellpositionqty")]
- public decimal sellpositionqty { get; set; }
- [PropertyDisc("sellholderamount")]
- public decimal sellholderamount { get; set; }
- [PropertyDisc("sellcurpositionqty")]
- public decimal sellcurpositionqty { get; set; }
- [PropertyDisc("sellcurholderamount")]
- public decimal sellcurholderamount { get; set; }
- [PropertyDisc("sellfrozenqty")]
- public decimal sellfrozenqty { get; set; }
- [PropertyDisc("sellotherfrozenqty")]
- public decimal sellotherfrozenqty { get; set; }
- [PropertyDisc("sellopenreqqty")]
- public decimal sellopenreqqty { get; set; }
- [PropertyDisc("sellreckonpl")]
- public decimal sellreckonpl { get; set; }
- [PropertyDisc("sellinterest")]
- public decimal sellinterest { get; set; }
- [PropertyDisc("sellusedmargin")]
- public decimal sellusedmargin { get; set; }
- [PropertyDisc("sellopentotalqty")]
- public decimal sellopentotalqty { get; set; }
- [PropertyDisc("sellclosetotalqty")]
- public decimal sellclosetotalqty { get; set; }
- [PropertyDisc("sellclosetotalpl")]
- public decimal sellclosetotalpl { get; set; }
- [PropertyDisc("tradeproperty")]
- public decimal tradeproperty { get; set; }
- [PropertyDisc("interest2")]
- public decimal interest2 { get; set; }
- [PropertyDisc("accountcurrencyid")]
- public decimal accountcurrencyid { get; set; }
- [PropertyDisc("goodscurrencyid")]
- public decimal goodscurrencyid { get; set; }
- [PropertyDisc("curexchangerate")]
- public decimal curexchangerate { get; set; }
- [PropertyDisc("buyreckonpl2")]
- public decimal buyreckonpl2 { get; set; }
- [PropertyDisc("sellreckonpl2")]
- public decimal sellreckonpl2 { get; set; }
- [PropertyDisc("trademode")]
- public int trademode { get; set; }
- [PropertyDisc("marketname")]
- public string marketname { get; set; }
- public string BuyAvgPriceDisplay
- {
- get
- {
- if (buycurpositionqty == 0) return "-";
- return (buycurholderamount/buycurpositionqty).ToString(PriceExpFormat);
- }
- }
- public string SellAvgPriceDisplay
- {
- get
- {
- if (sellcurpositionqty == 0) return "-";
- return (sellcurholderamount / sellcurpositionqty).ToString(PriceExpFormat);
- }
- }
- /// <summary>
- /// Gets the hold total amount.
- /// </summary>
- /// <value>The hold total amount.</value>
- public string HoldTotalAmountDisplay
- {
- get { return (buycurholderamount + sellcurholderamount).ToString("N2"); }
- }
- /// <summary>
- /// Gets the reckon pl display.
- /// </summary>
- /// <value>The reckon pl display.</value>
- public string ReckonPLDisplay
- {
- get { return (buyreckonpl + sellreckonpl).ToString("N2"); }
- }
- public string ReckonPL2Display
- {
- get { return (buyreckonpl2 + sellreckonpl2).ToString("N2"); }
- }
- /// <summary>
- /// Gets the buy qty display.
- /// </summary>
- /// <value>The buy qty display.</value>
- public string BuyQtyDisplay
- {
- get
- {
- if (buycurpositionqty == 0) return "-";
- return (buycurpositionqty).ToString();
- }
- }
- /// <summary>
- /// Gets the sell qty display.
- /// </summary>
- /// <value>The sell qty display.</value>
- public string SellQtyDisplay
- {
- get
- {
- if (sellcurpositionqty == 0) return "-";
- return (sellcurpositionqty).ToString();
- }
- }
- }
- }
|