QuoteGoodsDisplayPartial.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. using System;
  2. namespace Muchinfo.MTPClient.Data.Model
  3. {
  4. /// <summary>
  5. /// QuoteGoods Partial类(显示)
  6. /// </summary>
  7. public partial class QuoteGoods
  8. {
  9. #region Properties
  10. #region Public Properties
  11. /// <summary>
  12. /// 振幅
  13. /// </summary>
  14. public string AmplitudeDisplay
  15. {
  16. get
  17. {
  18. return Amplitude.ToString("P2");
  19. }
  20. }
  21. /// <summary>
  22. /// 卖价显示
  23. /// </summary>
  24. public string AskPriceDisplay
  25. {
  26. get
  27. {
  28. if (_askPrice <= 0)
  29. {
  30. return "-";
  31. }
  32. return _askPrice.ToString(FormatPrice);
  33. }
  34. }
  35. /// <summary>
  36. /// 均价显示
  37. /// </summary>
  38. public string AveragePriceDisplay
  39. {
  40. get
  41. {
  42. return GetAbbreviated((double)_averagePrice);
  43. }
  44. }
  45. /// <summary>
  46. /// 买价显示
  47. /// </summary>
  48. public string BidPriceDisplay
  49. {
  50. get
  51. {
  52. if (_bidPrice <= 0)
  53. {
  54. return "-";
  55. }
  56. return _bidPrice.ToString(FormatPrice);
  57. }
  58. }
  59. /// <summary>
  60. /// 买量显示
  61. /// </summary>
  62. public string BidVolumeDisplay
  63. {
  64. get
  65. {
  66. return GetAbbreviatedEx(_bidVolume, false);
  67. }
  68. }
  69. /// <summary>
  70. /// 现价显示
  71. /// </summary>
  72. public string CurrentPriceDisplay
  73. {
  74. get
  75. {
  76. if (_currentPrice <= 0)
  77. {
  78. return "-";
  79. }
  80. return _currentPrice.ToString(FormatPrice);
  81. }
  82. }
  83. /// <summary>
  84. /// 现量
  85. /// </summary>
  86. public string CurrentVolumeDisplay
  87. {
  88. get
  89. {
  90. return GetAbbreviatedEx(_currentVolume, false);
  91. }
  92. }
  93. /// <summary>
  94. /// 时间显示
  95. /// </summary>
  96. public string DateDisplay
  97. {
  98. get
  99. {
  100. if (_date == DateTime.MinValue)
  101. {
  102. return DefaultString;
  103. }
  104. return _date.ToString("HH:mm:ss");
  105. }
  106. }
  107. /// <summary>
  108. /// 日增仓
  109. /// </summary>
  110. public string DayAddPositionsDisplay
  111. {
  112. get
  113. {
  114. return GetAbbreviated(_dayAddPositions, "N0");
  115. }
  116. }
  117. /// <summary>
  118. /// 交收日显示
  119. /// </summary>
  120. public string DeliveryDateDisplay
  121. {
  122. get
  123. {
  124. return _deliveryDate.ToString("yyyyMMdd");
  125. }
  126. }
  127. /// <summary>
  128. /// 最高显示
  129. /// </summary>
  130. public string HighDisplay
  131. {
  132. get
  133. {
  134. if (_high <= 0)
  135. {
  136. return "-";
  137. }
  138. return _high.ToString(FormatPrice);
  139. }
  140. }
  141. /// <summary>
  142. /// 涨幅
  143. /// </summary>
  144. public string IncreasePercentDisplay
  145. {
  146. get
  147. {
  148. if (_currentPrice <= 0 || LastClose <= 0)
  149. {
  150. return "-";
  151. }
  152. return IncreasePercent.ToString("P2");
  153. }
  154. }
  155. /// <summary>
  156. /// 内盘
  157. /// </summary>
  158. public string InSizeDisplay
  159. {
  160. get
  161. {
  162. return GetAbbreviated((double)_inSize);
  163. }
  164. }
  165. /// <summary>
  166. /// 昨收显示
  167. /// </summary>
  168. public string
  169. LastCloseDisplay
  170. {
  171. get
  172. {
  173. if (_lastClose <= 0)
  174. {
  175. return "-";
  176. }
  177. return _lastClose.ToString(FormatPrice);
  178. }
  179. }
  180. /// <summary>
  181. /// 涨跌显示
  182. /// </summary>
  183. public string IncreaseValueDisplay
  184. {
  185. get
  186. {
  187. if (_currentPrice <= 0 || LastClose <= 0)
  188. {
  189. return "-";
  190. }
  191. return IncreaseValue.ToString(FormatPrice);
  192. }
  193. }
  194. /// <summary>
  195. /// 昨持仓量
  196. /// </summary>
  197. public string LastPositionsDisplay
  198. {
  199. get
  200. {
  201. return GetAbbreviatedEx(_lastPositions);
  202. }
  203. }
  204. /// <summary>
  205. /// 昨结算
  206. /// </summary>
  207. public string LastSettlementDisplay
  208. {
  209. get
  210. {
  211. return _lastSettlement.ToString(FormatPrice);
  212. }
  213. }
  214. /// <summary>
  215. /// 最低显示
  216. /// </summary>
  217. public string LowDisplay
  218. {
  219. get
  220. {
  221. if (_low <= 0)
  222. {
  223. return "-";
  224. }
  225. return _low.ToString(FormatPrice);
  226. }
  227. }
  228. /// <summary>
  229. /// 流通市值显示
  230. /// </summary>
  231. public string MarketCapitalizationsDisplay
  232. {
  233. get
  234. {
  235. return GetAbbreviated((double)_marketCapitalizations);
  236. }
  237. }
  238. /// <summary>
  239. /// 流通股本
  240. /// </summary>
  241. public string NegotiableSharesDisplay
  242. {
  243. get
  244. {
  245. return GetAbbreviated((double)_negotiableShares);
  246. }
  247. }
  248. /// <summary>
  249. /// 今开显示
  250. /// </summary>
  251. public string OpenDisplay
  252. {
  253. get
  254. {
  255. if (_open <= 0)
  256. {
  257. return "-";
  258. }
  259. return _open.ToString(FormatPrice);
  260. }
  261. }
  262. /// <summary>
  263. /// 交收价格
  264. /// </summary>
  265. public string DeliveryPriceDisplay
  266. {
  267. get
  268. {
  269. return _deliveryPrice.ToString(FormatPrice);
  270. }
  271. }
  272. /// <summary>
  273. /// 外盘
  274. /// </summary>
  275. public string OutSizeDisplay
  276. {
  277. get
  278. {
  279. return GetAbbreviated((double)_outSize);
  280. }
  281. }
  282. /// <summary>
  283. /// 持仓量显示
  284. /// </summary>
  285. public string PositionsDisplay
  286. {
  287. get
  288. {
  289. return GetAbbreviatedEx(_positions);
  290. }
  291. }
  292. /// <summary>
  293. /// 市盈率
  294. /// </summary>
  295. public string PriceEarningRatioDisplay
  296. {
  297. get
  298. {
  299. return GetAbbreviated((double)_priceEarningRatio);
  300. }
  301. }
  302. /// <summary>
  303. /// 结算
  304. /// </summary>
  305. public string SettlementDisplay
  306. {
  307. get
  308. {
  309. return GetAbbreviated((double)_settlement);
  310. }
  311. }
  312. /// <summary>
  313. /// 总股本显示
  314. /// </summary>
  315. public string TotalEquityDisplay
  316. {
  317. get
  318. {
  319. return GetAbbreviated((double)_totalEquity);
  320. }
  321. }
  322. /// <summary>
  323. /// 总额
  324. /// </summary>
  325. public string TotalTurnoverDisplay
  326. {
  327. get
  328. {
  329. if (_totalTurnover == 0)
  330. {
  331. return DefaultString;
  332. }
  333. return _totalTurnover.ToString("f2");
  334. // return GetAbbreviated((double)_totalTurnover);
  335. }
  336. }
  337. /// <summary>
  338. /// 总量显示
  339. /// </summary>
  340. public string TotalVolumeDisplay
  341. {
  342. get
  343. {
  344. if (_totalVolume == 0)
  345. {
  346. return DefaultString;
  347. }
  348. return _totalVolume.ToString("f0");
  349. // return GetAbbreviated(_totalVolume);
  350. }
  351. }
  352. /// <summary>
  353. /// 总库存量
  354. /// </summary>
  355. public string InventoryDisplay
  356. {
  357. get
  358. {
  359. //if (this.GoodsParameters != null && GoodsParameters.)
  360. //{
  361. // return DefaultString;
  362. //}
  363. //return _inventory.ToString("f0");
  364. return GetAbbreviatedEx(_totalVolume);
  365. }
  366. }
  367. /// <summary>
  368. /// 成交额显示
  369. /// </summary>
  370. public string TradeTurnoverDisplay
  371. {
  372. get
  373. {
  374. return GetAbbreviated((double)_tradeTurnover);
  375. }
  376. }
  377. /// <summary>
  378. /// 换手率
  379. /// </summary>
  380. public string TurnoverRateDisplay
  381. {
  382. get
  383. {
  384. if (this.TradeMode != eTradeMode.TRADEMODE_BIDDING)
  385. {
  386. return "-";
  387. }
  388. if (_turnoverRate != 0)
  389. {
  390. return GetAbbreviated((double)_turnoverRate);
  391. }
  392. else
  393. {
  394. if (_lastPositions == 0)
  395. {
  396. return "100%";//DefaultString;
  397. }
  398. else
  399. {
  400. return (_totalVolume / _lastPositions ).ToString("P2");
  401. }
  402. }
  403. }
  404. }
  405. /// <summary>
  406. /// 量比显示
  407. /// </summary>
  408. public string QuantityRelativeRatioDisplay
  409. {
  410. get
  411. {
  412. return GetAbbreviated((double)_quantityRelativeRatio);
  413. }
  414. }
  415. /// <summary>
  416. /// 委比
  417. /// </summary>
  418. public string WeiBiDisplay
  419. {
  420. get
  421. {
  422. return GetAbbreviated((double)WeiBi);
  423. }
  424. }
  425. /// <summary>
  426. /// 委差
  427. /// </summary>
  428. public string WeiChaDisplay
  429. {
  430. get
  431. {
  432. return GetAbbreviated((double)WeiCha);
  433. }
  434. }
  435. /// <summary>
  436. /// 格式化数据字符串
  437. /// </summary>
  438. public string FormatPrice
  439. {
  440. get
  441. {
  442. if (this.GoodsParameters == null)
  443. {
  444. return "F0";
  445. }
  446. else
  447. {
  448. if (this.GoodsParameters.HqExchFigures > 0 && this.GoodsParameters.HqExchFigures < 20)
  449. {
  450. return "F" + this.GoodsParameters.HqExchFigures;
  451. }
  452. else
  453. {
  454. return "F0";
  455. }
  456. }
  457. }
  458. }
  459. private decimal _raisesPrice;
  460. /// <summary>
  461. /// 涨停价
  462. /// </summary>
  463. public decimal RaisesPrice
  464. {
  465. get { return _raisesPrice; }
  466. set
  467. {
  468. Set(() => RaisesPrice, ref _raisesPrice, value);
  469. RaisePropertyChanged(() => RaisesPriceDisplay);
  470. RaisePropertyChanged(() => RaisesPriceColor);
  471. }
  472. }
  473. private decimal _fallsPrice;
  474. /// <summary>
  475. /// 跌停价
  476. /// </summary>
  477. public decimal FallsPrice
  478. {
  479. get { return _fallsPrice; }
  480. set
  481. {
  482. Set(() => FallsPrice, ref _fallsPrice, value);
  483. RaisePropertyChanged(() => FallsPriceDisplay);
  484. RaisePropertyChanged(() => FallsPriceColor);
  485. }
  486. }
  487. /// <summary>
  488. /// 发行总量
  489. /// </summary>
  490. public decimal IssueTotal
  491. {
  492. get; set;
  493. }
  494. /// <summary>
  495. /// 涨停价-显示字符
  496. /// </summary>
  497. public string RaisesPriceDisplay
  498. {
  499. get {
  500. //return (RaisesPrice == 0 || (this.TradeMode == eTradeMode.TRADEMODE_BIDDINGMARKETMAKE && this.IsQuoteValid)) ? "-" : RaisesPrice.ToString(FormatPrice);
  501. return (RaisesPrice == 0) ? "-" : RaisesPrice.ToString(FormatPrice);
  502. }
  503. }
  504. /// <summary>
  505. /// 跌停价-显示字符
  506. /// </summary>
  507. public string FallsPriceDisplay
  508. {
  509. //get { return (FallsPrice == 0 || (this.TradeMode == eTradeMode.TRADEMODE_BIDDINGMARKETMAKE&&this.IsQuoteValid)) ? "-" : FallsPrice.ToString(FormatPrice); }
  510. get { return (FallsPrice == 0) ? "-" : FallsPrice.ToString(FormatPrice); }
  511. }
  512. #endregion Public Properties
  513. #endregion Properties
  514. }
  515. }