using System; namespace Muchinfo.MTPClient.Data.Model { /// /// QuoteGoods Partial类(显示) /// public partial class QuoteGoods { #region Properties #region Public Properties /// /// 振幅 /// public string AmplitudeDisplay { get { return Amplitude.ToString("P2"); } } /// /// 卖价显示 /// public string AskPriceDisplay { get { if (_askPrice <= 0) { return "-"; } return _askPrice.ToString(FormatPrice); } } /// /// 均价显示 /// public string AveragePriceDisplay { get { return GetAbbreviated((double)_averagePrice); } } /// /// 买价显示 /// public string BidPriceDisplay { get { if (_bidPrice <= 0) { return "-"; } return _bidPrice.ToString(FormatPrice); } } /// /// 买量显示 /// public string BidVolumeDisplay { get { return GetAbbreviatedEx(_bidVolume, false); } } /// /// 现价显示 /// public string CurrentPriceDisplay { get { if (_currentPrice <= 0) { return "-"; } return _currentPrice.ToString(FormatPrice); } } /// /// 现量 /// public string CurrentVolumeDisplay { get { return GetAbbreviatedEx(_currentVolume, false); } } /// /// 时间显示 /// public string DateDisplay { get { if (_date == DateTime.MinValue) { return DefaultString; } return _date.ToString("HH:mm:ss"); } } /// /// 日增仓 /// public string DayAddPositionsDisplay { get { return GetAbbreviated(_dayAddPositions, "N0"); } } /// /// 交收日显示 /// public string DeliveryDateDisplay { get { return _deliveryDate.ToString("yyyyMMdd"); } } /// /// 最高显示 /// public string HighDisplay { get { if (_high <= 0) { return "-"; } return _high.ToString(FormatPrice); } } /// /// 涨幅 /// public string IncreasePercentDisplay { get { if (_currentPrice <= 0 || LastClose <= 0) { return "-"; } return IncreasePercent.ToString("P2"); } } /// /// 内盘 /// public string InSizeDisplay { get { return GetAbbreviated((double)_inSize); } } /// /// 昨收显示 /// public string LastCloseDisplay { get { if (_lastClose <= 0) { return "-"; } return _lastClose.ToString(FormatPrice); } } /// /// 涨跌显示 /// public string IncreaseValueDisplay { get { if (_currentPrice <= 0 || LastClose <= 0) { return "-"; } return IncreaseValue.ToString(FormatPrice); } } /// /// 昨持仓量 /// public string LastPositionsDisplay { get { return GetAbbreviatedEx(_lastPositions); } } /// /// 昨结算 /// public string LastSettlementDisplay { get { return _lastSettlement.ToString(FormatPrice); } } /// /// 最低显示 /// public string LowDisplay { get { if (_low <= 0) { return "-"; } return _low.ToString(FormatPrice); } } /// /// 流通市值显示 /// public string MarketCapitalizationsDisplay { get { return GetAbbreviated((double)_marketCapitalizations); } } /// /// 流通股本 /// public string NegotiableSharesDisplay { get { return GetAbbreviated((double)_negotiableShares); } } /// /// 今开显示 /// public string OpenDisplay { get { if (_open <= 0) { return "-"; } return _open.ToString(FormatPrice); } } /// /// 交收价格 /// public string DeliveryPriceDisplay { get { return _deliveryPrice.ToString(FormatPrice); } } /// /// 外盘 /// public string OutSizeDisplay { get { return GetAbbreviated((double)_outSize); } } /// /// 持仓量显示 /// public string PositionsDisplay { get { return GetAbbreviatedEx(_positions); } } /// /// 市盈率 /// public string PriceEarningRatioDisplay { get { return GetAbbreviated((double)_priceEarningRatio); } } /// /// 结算 /// public string SettlementDisplay { get { return GetAbbreviated((double)_settlement); } } /// /// 总股本显示 /// public string TotalEquityDisplay { get { return GetAbbreviated((double)_totalEquity); } } /// /// 总额 /// public string TotalTurnoverDisplay { get { if (_totalTurnover == 0) { return DefaultString; } return _totalTurnover.ToString("f2"); // return GetAbbreviated((double)_totalTurnover); } } /// /// 总量显示 /// public string TotalVolumeDisplay { get { if (_totalVolume == 0) { return DefaultString; } return _totalVolume.ToString("f0"); // return GetAbbreviated(_totalVolume); } } /// /// 总库存量 /// public string InventoryDisplay { get { //if (this.GoodsParameters != null && GoodsParameters.) //{ // return DefaultString; //} //return _inventory.ToString("f0"); return GetAbbreviatedEx(_totalVolume); } } /// /// 成交额显示 /// public string TradeTurnoverDisplay { get { return GetAbbreviated((double)_tradeTurnover); } } /// /// 换手率 /// public string TurnoverRateDisplay { get { if (this.TradeMode != eTradeMode.TRADEMODE_BIDDING) { return "-"; } if (_turnoverRate != 0) { return GetAbbreviated((double)_turnoverRate); } else { if (_lastPositions == 0) { return "100%";//DefaultString; } else { return (_totalVolume / _lastPositions ).ToString("P2"); } } } } /// /// 量比显示 /// public string QuantityRelativeRatioDisplay { get { return GetAbbreviated((double)_quantityRelativeRatio); } } /// /// 委比 /// public string WeiBiDisplay { get { return GetAbbreviated((double)WeiBi); } } /// /// 委差 /// public string WeiChaDisplay { get { return GetAbbreviated((double)WeiCha); } } /// /// 格式化数据字符串 /// public string FormatPrice { get { if (this.GoodsParameters == null) { return "F0"; } else { if (this.GoodsParameters.HqExchFigures > 0 && this.GoodsParameters.HqExchFigures < 20) { return "F" + this.GoodsParameters.HqExchFigures; } else { return "F0"; } } } } private decimal _raisesPrice; /// /// 涨停价 /// public decimal RaisesPrice { get { return _raisesPrice; } set { Set(() => RaisesPrice, ref _raisesPrice, value); RaisePropertyChanged(() => RaisesPriceDisplay); RaisePropertyChanged(() => RaisesPriceColor); } } private decimal _fallsPrice; /// /// 跌停价 /// public decimal FallsPrice { get { return _fallsPrice; } set { Set(() => FallsPrice, ref _fallsPrice, value); RaisePropertyChanged(() => FallsPriceDisplay); RaisePropertyChanged(() => FallsPriceColor); } } /// /// 发行总量 /// public decimal IssueTotal { get; set; } /// /// 涨停价-显示字符 /// public string RaisesPriceDisplay { get { //return (RaisesPrice == 0 || (this.TradeMode == eTradeMode.TRADEMODE_BIDDINGMARKETMAKE && this.IsQuoteValid)) ? "-" : RaisesPrice.ToString(FormatPrice); return (RaisesPrice == 0) ? "-" : RaisesPrice.ToString(FormatPrice); } } /// /// 跌停价-显示字符 /// public string FallsPriceDisplay { //get { return (FallsPrice == 0 || (this.TradeMode == eTradeMode.TRADEMODE_BIDDINGMARKETMAKE&&this.IsQuoteValid)) ? "-" : FallsPrice.ToString(FormatPrice); } get { return (FallsPrice == 0) ? "-" : FallsPrice.ToString(FormatPrice); } } #endregion Public Properties #endregion Properties } }