using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Data.Helper; using Muchinfo.MTPClient.Resources; namespace Muchinfo.MTPClient.Data.Model.Account { using System; /// /// 持仓汇总2.0 /// public class HoldingOrder20 : OrderBase { #region Fields /// /// 成交单号 /// private decimal _tradeid; /// /// 账号Id /// private decimal _accountid; /// /// 持仓价格 /// private decimal _holderPrice; /// /// 持仓数量 /// private decimal _holderqty; /// /// 持仓金额 /// private decimal _holderamount; /// /// 建仓价格 /// private decimal _openprice; /// /// 成交金额 /// private decimal _tradeamount; /// /// 冻结数量 /// private decimal _freezeqty; /// ///持仓天数 /// private decimal _holderdays; /// /// 释放持仓金额 /// private decimal _releaseamount; /// /// 建仓数量 /// private decimal _openqty; /// /// 交易时间 /// private DateTime _tradetime; /// /// 昨结价 /// private decimal _preClosePrice; /// /// 结算价 /// private decimal _preSettlePrice; /// /// 持仓盈亏 /// private decimal _profitLoss; /// /// 最新价 /// private decimal _lastPrice; #endregion Fields /// /// Sets and gets 成交单号 /// Changes to that property's value raise the PropertyChanged event. /// [PropertyDisc("TradeID")] public decimal TradeID { get { return _tradeid; } set { Set(() => TradeID, ref _tradeid, value); } } /// /// 账户ID /// public decimal AccountID { get { return _accountid; } set { Set(() => AccountID, ref _accountid, value); } } /// /// Sets and gets 持仓价 /// Changes to that property's value raise the PropertyChanged event. /// [PropertyDisc("HolderPrice")] public decimal HolderPrice { get { return _holderPrice; } set { Set(() => HolderPrice, ref _holderPrice, value); } } [PropertyDisc("HolderQty")] public decimal HolderQty { get { return _holderqty; } set { _holderqty = value; } } [PropertyDisc("HolderAmount")] public decimal HolderAmount { get { return _holderamount; } set { _holderamount = value; } } [PropertyDisc("OpenPrice")] public decimal OpenPrice { get { return _openprice; } set { Set(() => OpenPrice, ref _openprice, value); } } [PropertyDisc("TradeAmount")] public decimal TradeAmount { get { return _tradeamount; } set { _tradeamount = value; } } [PropertyDisc("FreezeQty")] public decimal FreezeQty { get { return _freezeqty; } set { _freezeqty = value; } } public decimal HolderDays { get { return _holderdays; } set { _holderdays = value; } } public decimal ReleaseAmount { get { return _releaseamount; } set { _releaseamount = value; } } [PropertyDisc("OpenQty")] public decimal OpenQty { get { return _openqty; } set { _openqty = value; } } [PropertyDisc("TradeTime")] public DateTime TradeTime { get { return _tradetime; } set { Set(() => TradeTime, ref _tradetime, value); RaisePropertyChanged(() => TradeTimeDisplay); } } [PropertyDisc("PreClosePrice")] public decimal PreClosePrice { get { return _preClosePrice; } set { Set(() => PreClosePrice, ref _preClosePrice, value); } } [PropertyDisc("ProfitLoss")] public decimal ProfitLoss { get { return _profitLoss; } set { Set(() => ProfitLoss, ref _profitLoss, value); } } [PropertyDisc("PreSettlePrice")] public decimal PreSettlePrice { get { return _preClosePrice; } set { Set(() => PreSettlePrice, ref _preSettlePrice, value); } } public decimal LastPrice { get { return _lastPrice; } set { Set(() => LastPrice, ref _lastPrice, value); } } public string TradeTimeDisplay { get { return TradeTime.ToString("yyyy-MM-dd HH:mm:ss"); } } public string StrOpenDirection { get { return Direction.Discription(); } } /// /// Gets the hold price display. /// /// The hold price display. public string HoldPriceDisplay { get { return HolderPrice.ToString(PriceFormat); } } /// /// Gets the open price display. /// /// The open price display. public string OpenPriceDisplay { get { return OpenPrice.ToString(PriceFormat); } } public string PreClosePriceDisplay { get { return PreClosePrice.ToString(PriceFormat); } } public string PreSettlePriceDisplay { get { return PreSettlePrice.ToString(PriceFormat); } } public string ProfitLossDisplay { get { return ProfitLoss.ToString("F2"); } } } }