16 using System.Collections.Generic;
19 using Newtonsoft.Json;
53 : this(name, index,
"$")
88 public void AddPoint(DateTime time, decimal open, decimal high, decimal low, decimal close)
90 base.AddPoint(
new Candlestick(time, open, high, low, close));
109 throw new ArgumentException(
"CandlestickSeries.AddPoint requires a Candlestick object");
112 base.AddPoint(point);
120 public override void AddPoint(DateTime time, List<decimal> values)
122 if (values.Count != 4)
124 throw new ArgumentException(
"CandlestickSeries.AddPoint requires 4 values (open, high, low, close)");
127 base.AddPoint(
new Candlestick(time, values[0], values[1], values[2], values[3]));
136 if (
Values.Count <= 0)
return null;
138 decimal? openSum =
null;
139 decimal? highSum =
null;
140 decimal? lowSum =
null;
141 decimal? closeSum =
null;
144 if (point.
Open.HasValue)
147 openSum += point.
Open.Value;
149 if (point.
High.HasValue)
152 highSum += point.
High.Value;
154 if (point.
Low.HasValue)
157 lowSum += point.
Low.Value;
159 if (point.
Close.HasValue)
162 closeSum += point.
Close.Value;
167 return new Candlestick(lastCandlestick.Time, openSum, highSum, lowSum, closeSum);