public static Imports.importOHLCV DoImportRow(LumenWorks.Framework.IO.Csv.CsvReader csv, Imports.importStat importStat) { Imports.importOHLCV data = new Imports.importOHLCV(); if (csv[0] == null) return null; data.code = csv[0]; if (!common.dateTimeLibs.Str2Date(csv[1] + csv[2], importStat.dateDataFormat, out tmpDate)) return null; data.dateTime = tmpDate; if (!double.TryParse(csv[3], NumberStyles.Number, importStat.srcCulture, out tmpVal)) return null; if (tmpVal <= 0) return null; data.Open = tmpVal; if (!double.TryParse(csv[4], NumberStyles.Number, importStat.srcCulture, out tmpVal)) return null; if (tmpVal <= 0) return null; data.High = tmpVal; if (!double.TryParse(csv[5], NumberStyles.Number, importStat.srcCulture, out tmpVal)) return null; if (tmpVal <= 0) return null; data.Low = tmpVal; if (!double.TryParse(csv[6], NumberStyles.Number, importStat.srcCulture, out tmpVal)) return null; if (tmpVal <= 0) return null; data.Close = tmpVal; if (!double.TryParse(csv[7], NumberStyles.Number, importStat.srcCulture, out tmpVal)) return null; data.Volume = tmpVal; return data; }
public static Imports.importOHLCV DoImportRow(LumenWorks.Framework.IO.Csv.CsvReader csv, Imports.importStat importStat) { Imports.importOHLCV data = new Imports.importOHLCV(); if (csv[0] == null) { return(null); } data.code = csv[0]; if (!common.dateTimeLibs.Str2Date(csv[1] + csv[2], importStat.dateDataFormat, out tmpDate)) { return(null); } data.dateTime = tmpDate; if (!double.TryParse(csv[3], NumberStyles.Number, importStat.srcCulture, out tmpVal)) { return(null); } if (tmpVal <= 0) { return(null); } data.Open = tmpVal; if (!double.TryParse(csv[4], NumberStyles.Number, importStat.srcCulture, out tmpVal)) { return(null); } if (tmpVal <= 0) { return(null); } data.High = tmpVal; if (!double.TryParse(csv[5], NumberStyles.Number, importStat.srcCulture, out tmpVal)) { return(null); } if (tmpVal <= 0) { return(null); } data.Low = tmpVal; if (!double.TryParse(csv[6], NumberStyles.Number, importStat.srcCulture, out tmpVal)) { return(null); } if (tmpVal <= 0) { return(null); } data.Close = tmpVal; if (!double.TryParse(csv[7], NumberStyles.Number, importStat.srcCulture, out tmpVal)) { return(null); } data.Volume = tmpVal; return(data); }