Exemplo n.º 1
0
        public void SetNewData(bool isHistory, BarsFileData newBarsFileData)
        {
            lock (_locked) {
                BarsFileData bfd = isHistory ? this.History : this.Cache;
                if (bfd != null)
                {
                    bfd.CloseStream();
                    bfd.File.Delete();
                }

                string fn = newBarsFileData.File.FullName;
                fn = fn.Substring(0, fn.Length - 4);
                newBarsFileData.File.MoveTo(fn);

                if (isHistory)
                {
                    _history = new BarsFileData(new FileInfo(fn));
                    _session.IncrementsLevel1();
                }
                else
                {
                    _cache = new BarsFileData(new FileInfo(fn));
                    _session.IncrementsLevel2();
                }
            }
        }
Exemplo n.º 2
0
        public TicksManager()
        {
            _sessionSource = new SessionSource();
            _sessionDest   = new SessionDest(_sessionSource);
            _sessionSource.IncrementsLevel1();

            _barsManager = new BarsManager(this);
            _map         = new TicksMapManager(this);
        }
Exemplo n.º 3
0
        private TicksFileData(FileInfo file, bool loadInfo)
        {
            _file = file;

            _sessionSource = new SessionSource();
            _sessionDest   = new SessionDest(_sessionSource);
            _sessionSource.IncrementsLevel1();

            if (loadInfo)
            {
                this.LoadFileInfo();
            }
        }