public Add ( System.DateTime dateTime, double value ) : void | ||
dateTime | System.DateTime | |
value | double | |
return | void |
public void Add(DateTime dateTime, double value)
{
var item = new TimeSeriesItem(dateTime, value);
this.max = this.max == null ? item : (this.max.Value < item.Value ? item : this.max);
this.min = this.min == null ? item : (this.min.Value > item.Value ? item : this.min);
this.series.Add(item);
// Update the dependent indicators
foreach (var indicator in Indicators.Where(i => i.AutoUpdate))
indicator.Update((int)this.series.Count - 1);
}
private TimeSeries MathTransform(string name, Func <double, double> func) { var ts = new TimeSeries(name, this.description, -1); for (int i = 0; i < Count; i++) { ts.Add(GetDateTime(i), func(this[i, 0])); } return(ts); }