BarDataPoint.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using MuchInfo.Chart.Data.Interfaces;
  2. using Newtonsoft.Json;
  3. using System;
  4. namespace MuchInfo.Chart.Data.Models
  5. {
  6. /// <summary>
  7. /// 柱数据点
  8. /// </summary>
  9. public class BarDataPoint : OHLCDataPoint, IBarDataPoint
  10. {
  11. #region Constructors
  12. /// <summary>
  13. /// 构造函数
  14. /// </summary>
  15. /// <param name="date">日期</param>
  16. /// <param name="open">开盘价</param>
  17. /// <param name="high">最高价</param>
  18. /// <param name="low">最低价</param>
  19. /// <param name="close">收盘价</param>
  20. /// <param name="increase">涨幅</param>
  21. /// <param name="volume">成交量</param>
  22. /// <param name="turnOver">成交额</param>
  23. /// <param name="holdVolume">持仓量</param>
  24. [JsonConstructor]
  25. public BarDataPoint(DateTime date, float open, float high, float low, float close, float volume, float turnOver, float holdVolume, float increase = 0)
  26. : base(date, open, high, low, close, increase)
  27. {
  28. this.Volume = volume;
  29. this.Turnover = turnOver;
  30. this.HoldVolume = holdVolume;
  31. }
  32. /// <summary>
  33. /// 在指标编辑器中使用这个构造函数
  34. /// </summary>
  35. /// <param name="date">时间</param>
  36. /// <param name="value">值</param>
  37. public BarDataPoint(DateTime date, float value)
  38. : base(date, value, value, value, value)
  39. {
  40. }
  41. #endregion Constructors
  42. #region Properties
  43. #region Public Properties
  44. /// <summary>
  45. /// 持仓量
  46. /// </summary>
  47. /// <value>The hold volume.</value>
  48. public float HoldVolume
  49. {
  50. get;
  51. set;
  52. }
  53. /// <summary>
  54. /// 成交额
  55. /// </summary>
  56. public float Turnover
  57. {
  58. get;
  59. set;
  60. }
  61. /// <summary>
  62. /// 成交量
  63. /// </summary>
  64. public float Volume
  65. {
  66. get;
  67. set;
  68. }
  69. #endregion Public Properties
  70. #endregion Properties
  71. }
  72. }