Example #1
0
        private SecurityImpl getsec(string file)
        {
            try
            {
                //Check if file contains a zip definition
                if (file.ToLower().Contains("zip"))
                {
                    //Get zip file and tik file from filename
                    string[] parts    = file.ToLower().Split('\\');
                    string   tickfile = parts.Skip(parts.Length - 1).First();
                    string   zipfile  = string.Join(@"\", parts.Take(parts.Length - 1));

                    return(SecurityImpl.FromZIP(zipfile, tickfile));
                }
                else
                {
                    return(SecurityImpl.FromTIK(file));
                }
            }
            catch (Exception ex)
            {
                debug("error reading TIK file: " + file + " err: " + ex.Message + ex.StackTrace);
                return(null);
            }
        }
Example #2
0
        void LoadEPF(string file)
        {
            SecurityImpl s;

            try
            {
                _dt.Clear();
                s = SecurityImpl.FromTIK(file);
                if (s.Type == SecurityType.CASH)
                {
                    _dp = 5;
                }
                total  = s.ApproxTicks;
                symbol = s.symbol;
                date   = s.Date;
            }
            catch (Exception ex)
            {
                debug("error opening: " + file + " err: " + ex.Message + ex.StackTrace);
                status("Error.  Is file closed?");
                return;
            }
            if (!bw.IsBusy)
            {
                bw.RunWorkerAsync(s);
            }
            else
            {
                status("try again.");
            }
        }
Example #3
0
        void LoadEPF(string file)
        {
            SecurityImpl s;

            try
            {
                _dt.Clear();
                s      = SecurityImpl.FromTIK(file);
                total  = s.ApproxTicks;
                symbol = s.Symbol;
                date   = s.Date;
            }
            catch (Exception ex) { status("Error.  Is file closed?"); return; }
            if (!bw.IsBusy)
            {
                bw.RunWorkerAsync(s);
            }
            else
            {
                status("try again.");
            }
        }