OHLCDataPoint.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. using MuchInfo.Chart.Data.Interfaces;
  2. using System;
  3. namespace MuchInfo.Chart.Data.Models
  4. {
  5. /// <summary>
  6. /// OHLC数据点
  7. /// </summary>
  8. public class OHLCDataPoint : IOHLCDataPoint
  9. {
  10. #region Constructors
  11. /// <summary>
  12. /// 构造函数
  13. /// </summary>
  14. /// <param name="date">日期</param>
  15. /// <param name="open">开盘价</param>
  16. /// <param name="high">最高价</param>
  17. /// <param name="low">最低价</param>
  18. /// <param name="close">收盘价</param>
  19. /// <param name="increase">涨幅</param>
  20. public OHLCDataPoint(DateTime date, float open, float high, float low, float close, float increase = 0, float increaseValue = 0)
  21. {
  22. this.Date = date;
  23. this.Open = open;
  24. this.Low = low;
  25. this.High = high;
  26. this.Close = close;
  27. this.Value = close;
  28. this.Increase = increase;
  29. this.IncreaseValue = increaseValue;
  30. }
  31. /// <summary>
  32. /// 在指标编辑器中使用这个构造函数
  33. /// </summary>
  34. /// <param name="date">时间</param>
  35. /// <param name="value">值</param>
  36. public OHLCDataPoint(DateTime date, float value)
  37. {
  38. this.Date = date;
  39. this.Value = value;
  40. }
  41. #endregion Constructors
  42. #region Properties
  43. #region Public Properties
  44. /// <summary>
  45. /// 收盘价
  46. /// </summary>
  47. public float Close
  48. {
  49. get;
  50. set;
  51. }
  52. /// <summary>
  53. /// 日期
  54. /// </summary>
  55. public DateTime Date
  56. {
  57. get;
  58. set;
  59. }
  60. /// <summary>
  61. /// 最高价
  62. /// </summary>
  63. public float High
  64. {
  65. get;
  66. set;
  67. }
  68. /// <summary>
  69. /// 涨幅
  70. /// </summary>
  71. /// <value>The increase.</value>
  72. public float Increase
  73. {
  74. get;
  75. set;
  76. }
  77. /// <summary>
  78. /// 涨跌
  79. /// </summary>
  80. /// <value>The increase.</value>
  81. public float IncreaseValue
  82. {
  83. get;
  84. set;
  85. }
  86. /// <summary>
  87. /// 最低价
  88. /// </summary>
  89. public float Low
  90. {
  91. get;
  92. set;
  93. }
  94. /// <summary>
  95. /// 开盘价
  96. /// </summary>
  97. public float Open
  98. {
  99. get;
  100. set;
  101. }
  102. /// <summary>
  103. /// 值
  104. /// </summary>
  105. public float Value
  106. {
  107. get;
  108. set;
  109. }
  110. #endregion Public Properties
  111. #endregion Properties
  112. }
  113. }