using System.Collections.Generic;
using System.Collections;
using System.Collections.Generic;
using System.Data.DataSetExtensions;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using System.Globalization;
using System.Diagnostics;
using System.Collections.Concurrent;
public static void Main()
List<History> data = new List<History>(){
new History() {Symbol="a", Close = 1.0m, Date = new DateTime(2016, 2, 1) },
new History() {Symbol="a", Close = 1.2m, Date = new DateTime(2016, 2, 2) },
new History() {Symbol="a", Close = 1.3m, Date = new DateTime(2016, 2, 3) },
new History() {Symbol="b", Close = 1.2m, Date = new DateTime(2016, 2, 1) },
new History() {Symbol="b", Close = 1.2m, Date = new DateTime(2016, 2, 2) },
new History() {Symbol="b", Close = 1.3m, Date = new DateTime(2016, 2, 3) },
.Select(x=>new {x.Symbol, x.Close, x.Date, Vol = 0.0m})
.Concat(data.Zip(data.Skip(1), (first,second) =>
Vol = first.Close + second.Close
foreach(var result in results)
Console.WriteLine("Symbol ={0}, Close={1}, Date={2}, Vol = {3}", result.Symbol, result.Close, result.Date, result.Vol);