public Bars BarsLoadAll() { string msig = " BarsLoadAll(this.Abspath=[" + this.Abspath + "]): "; Bars bars = null; DateTime dateTime = DateTime.Now; FileStream fileStream = null; try { fileStream = File.Open(this.Abspath, FileMode.Open, FileAccess.Read, FileShare.Read); BinaryReader binaryReader = new BinaryReader(fileStream); double version = binaryReader.ReadDouble(); //Assembler.PopupException("LoadBars[" + this.Relpath + "]: version[" + version + "]"); string symbol = binaryReader.ReadString(); string symbolHumanReadable = binaryReader.ReadString(); BarScale barScale = (BarScale)binaryReader.ReadInt32(); int barInterval = binaryReader.ReadInt32(); BarScaleInterval scaleInterval = new BarScaleInterval(barScale, barInterval); //string shortFnameIneedMorePathParts = Path.GetFileName(this.Abspath); //string shortFname = this.Abspath.Substring(this.Abspath.IndexOf("" + Path.DirectorySeparatorChar + "Data" + Path.DirectorySeparatorChar + "") + 6); string shortFname = this.Relpath; bars = new Bars(symbol, scaleInterval, shortFname); int barsStored = binaryReader.ReadInt32(); //int securityType = binaryReader.ReadInt32(); //bars.SymbolInfo.SecurityType = (SecurityType)securityType; for (int barsRead = 0; barsRead < barsStored; barsRead++) { DateTime dateTimeOpen = new DateTime(binaryReader.ReadInt64()); double open = binaryReader.ReadDouble(); double high = binaryReader.ReadDouble(); double low = binaryReader.ReadDouble(); double close = binaryReader.ReadDouble(); double volume = binaryReader.ReadDouble(); Bar barAdded = bars.BarCreateAppendBindStatic(dateTimeOpen, open, high, low, close, volume); } } catch (EndOfStreamException ex) { Assembler.PopupException(ex.Message + msig, ex); } finally { if (fileStream != null) { fileStream.Close(); } } return(bars); }