/// <summary> /// Loads the data file /// </summary> /// <returns>0 - success</returns> public int LoadData() { // The source data file full name string sourceDataFile = pathDataDir + instrProperties.BaseFileName + period.ToString() + ".csv"; // Checks the access to the file if (!File.Exists(sourceDataFile)) { return(1); } StreamReader sr = new StreamReader(sourceDataFile); string sData = sr.ReadToEnd(); sr.Close(); Data_Parser dp = new Data_Parser(); int respond = -1; int parsedBars = dp.Parse(sData); if (parsedBars > 0) { aBar = dp.Bar; bars = parsedBars; RefineData(); DataHorizon(); CheckMarketData(); SetDataStats(); timeUpdate = aBar[bars - 1].Time; respond = 0; } return(respond); }
/// <summary> /// Loads the data file /// </summary> /// <returns>0 - success</returns> public int LoadResourceData() { Data_Parser dataParser = new Data_Parser(Properties.Resources.EURUSD1440); int respond = dataParser.Parse(); if (respond == 0) { aBar = dataParser.Bar; bars = dataParser.Bars; RefineData(); DataHorizon(); CheckMarketData(); SetDataStats(); timeUpdate = aBar[bars - 1].Time; } return(respond); }
/// <summary> /// Loads the data file /// </summary> /// <returns>0 - success</returns> public int LoadResourceData() { Data_Parser dataParser = new Data_Parser(); int respond = -1; int parsedBars = dataParser.Parse(Properties.Resources.EURUSD1440); if (parsedBars > 0) { aBar = dataParser.Bar; bars = parsedBars; RefineData(); DataHorizon(); CheckMarketData(); SetDataStats(); timeUpdate = aBar[bars - 1].Time; respond = 0; } return respond; }
/// <summary> /// Loads the data file /// </summary> /// <returns>0 - success</returns> public int LoadData() { // The source data file full name string sourceDataFile = pathDataDir + instrProperties.BaseFileName + period.ToString() + ".csv"; // Checks the access to the file if (!File.Exists(sourceDataFile)) return 1; StreamReader sr = new StreamReader(sourceDataFile); string sData = sr.ReadToEnd(); sr.Close(); Data_Parser dp = new Data_Parser(); int respond = -1; int parsedBars = dp.Parse(sData); if (parsedBars > 0) { aBar = dp.Bar; bars = parsedBars; RefineData(); DataHorizon(); CheckMarketData(); SetDataStats(); timeUpdate = aBar[bars - 1].Time; respond = 0; } return respond; }