Exemplo n.º 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;
        }
Exemplo n.º 2
0
        public static bool ImportOHLCV_CSV(string csvFileName,string stockExchangeForNewCode,
                                           data.baseDS.priceDataDataTable priceDataTbl,
                                           libs.OnUpdatePriceData onUpdateDataFunc)
        {

            return libs.ImportOHLCV_CSV(csvFileName, ',', common.dateTimeLibs.DateTimeFormats.YYMMDD,
                                        stockExchangeForNewCode,libs.CultureInfoVN,
                                        priceDataTbl, DoImportRow, onUpdateDataFunc, null);

        }