DataSeries(string description)
DataSeries(Bars bars, string description)
DataSeries(DataSeries source, string description)
The DataSeries object represents a series of values (double type) with corresponding dates. You can perform mathematical operations on DataSeries as if they were primary types:
//Get average of high and low price
DataSeries avg = (High + Low) / 2;
You can also create offset copies of a DataSeries by using the shift operators, >> and <<:
//Shift a moving average 2 bars to the right
DataSeries shiftedMA = SMA.Series(Close, 14) >> 2;
The most practical use of the DataSeries function is to return a new zero-filled DataSeries that has the same number of elements as the Bars parameter. Use the result to fill the series bar by bar with calculated values: