public static string ToFormattedString(this BarField field) { int yyyy = field.Date / 10000; int MM = field.Date % 10000 / 100; int dd = field.Date % 100; int hh = field.Time / 10000; int mm = field.Time % 10000 / 100; int ss = field.Time % 100; string date = string.Format("{0}-{1:D2}-{2:D2} {3:D2}:{4:D2}:{5:D2}.000", yyyy, MM, dd, hh, mm, ss); return(string.Format("{0},{1},{2},{3},{4},{5},{6}", date, field.Open, field.High, field.Low, field.Close, field.Volume, field.OpenInterest)); }
public static string ToFormattedHeader(this BarField field) { return("DateTime,Open,High,Low,Close,Volume,OpenInt"); }