| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using MuchInfo.Chart.Data.Interfaces;
- using Newtonsoft.Json;
- using System;
- namespace MuchInfo.Chart.Data.Models
- {
- /// <summary>
- /// 柱数据点
- /// </summary>
- public class BarDataPoint : OHLCDataPoint, IBarDataPoint
- {
- #region Constructors
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="date">日期</param>
- /// <param name="open">开盘价</param>
- /// <param name="high">最高价</param>
- /// <param name="low">最低价</param>
- /// <param name="close">收盘价</param>
- /// <param name="increase">涨幅</param>
- /// <param name="volume">成交量</param>
- /// <param name="turnOver">成交额</param>
- /// <param name="holdVolume">持仓量</param>
- [JsonConstructor]
- public BarDataPoint(DateTime date, float open, float high, float low, float close, float volume, float turnOver, float holdVolume, float increase = 0)
- : base(date, open, high, low, close, increase)
- {
- this.Volume = volume;
- this.Turnover = turnOver;
- this.HoldVolume = holdVolume;
- }
- /// <summary>
- /// 在指标编辑器中使用这个构造函数
- /// </summary>
- /// <param name="date">时间</param>
- /// <param name="value">值</param>
- public BarDataPoint(DateTime date, float value)
- : base(date, value, value, value, value)
- {
- }
- #endregion Constructors
- #region Properties
- #region Public Properties
- /// <summary>
- /// 持仓量
- /// </summary>
- /// <value>The hold volume.</value>
- public float HoldVolume
- {
- get;
- set;
- }
- /// <summary>
- /// 成交额
- /// </summary>
- public float Turnover
- {
- get;
- set;
- }
- /// <summary>
- /// 成交量
- /// </summary>
- public float Volume
- {
- get;
- set;
- }
- #endregion Public Properties
- #endregion Properties
- }
- }
|