16 using System.Collections.Generic;
19 using Newtonsoft.Json;
53 : this(name, index,
"$")
87 public void AddPoint(DateTime time, decimal open, decimal high, decimal low, decimal close)
89 base.AddPoint(
new Candlestick(time, open, high, low, close));
108 throw new ArgumentException(
"CandlestickSeries.AddPoint requires a Candlestick object");
111 base.AddPoint(point);
119 public override void AddPoint(DateTime time, List<decimal> values)
121 if (values.Count != 4)
123 throw new ArgumentException(
"CandlestickSeries.AddPoint requires 4 values (open, high, low, close)");
126 base.AddPoint(
new Candlestick(time, values[0], values[1], values[2], values[3]));
135 if (
Values.Count <= 0)
return null;
137 decimal? openSum =
null;
138 decimal? highSum =
null;
139 decimal? lowSum =
null;
140 decimal? closeSum =
null;
143 if (point.
Open.HasValue)
146 openSum += point.
Open.Value;
148 if (point.
High.HasValue)
151 highSum += point.
High.Value;
153 if (point.
Low.HasValue)
156 lowSum += point.
Low.Value;
158 if (point.
Close.HasValue)
161 closeSum += point.
Close.Value;
166 return new Candlestick(lastCandlestick.Time, openSum, highSum, lowSum, closeSum);