示例#1
0
        private static libs.importOHLCV DoImportRow(LumenWorks.Framework.IO.Csv.CsvReader csv, libs.importStat importStat)
        {
            libs.importOHLCV data = new libs.importOHLCV();
            if (csv[0] == null) return null;
            data.code = csv[0];

            if (!common.dateTimeLibs.Str2Date(csv[1], importStat.dateFormat, out tmpDate)) return null;
            data.dateTime = tmpDate;

            if (!double.TryParse(csv[2], NumberStyles.Number, importStat.culture, out tmpVal)) return null;
            data.Open = tmpVal;

            if (!double.TryParse(csv[3], NumberStyles.Number, importStat.culture, out tmpVal)) return null;
            data.High = tmpVal;

            if (!double.TryParse(csv[4], NumberStyles.Number, importStat.culture, out tmpVal)) return null;
            data.Low = tmpVal;

            if (!double.TryParse(csv[5], NumberStyles.Number, importStat.culture, out tmpVal)) return null;
            data.Close = tmpVal;

            if (!double.TryParse(csv[6], NumberStyles.Number, importStat.culture, out tmpVal)) return null;
            data.Volume = tmpVal;
            return data;
        }
示例#2
0
        private static libs.importOHLCV DoImportRow(LumenWorks.Framework.IO.Csv.CsvReader csv, libs.importStat importStat)
        {
            libs.importOHLCV data = new libs.importOHLCV();
            if (csv[0] == null)
            {
                return(null);
            }
            data.code = csv[0];

            if (!common.dateTimeLibs.Str2Date(csv[1], importStat.dateFormat, out tmpDate))
            {
                return(null);
            }
            data.dateTime = tmpDate;

            if (!double.TryParse(csv[2], NumberStyles.Number, importStat.culture, out tmpVal))
            {
                return(null);
            }
            data.Open = tmpVal;

            if (!double.TryParse(csv[3], NumberStyles.Number, importStat.culture, out tmpVal))
            {
                return(null);
            }
            data.High = tmpVal;

            if (!double.TryParse(csv[4], NumberStyles.Number, importStat.culture, out tmpVal))
            {
                return(null);
            }
            data.Low = tmpVal;

            if (!double.TryParse(csv[5], NumberStyles.Number, importStat.culture, out tmpVal))
            {
                return(null);
            }
            data.Close = tmpVal;

            if (!double.TryParse(csv[6], NumberStyles.Number, importStat.culture, out tmpVal))
            {
                return(null);
            }
            data.Volume = tmpVal;
            return(data);
        }