示例#1
0
        public static StockDataHeader FromXMaster(XMasterRec rec)
        {
            var r = new StockDataHeader();

            switch (rec.TimeFrame)
            {
            case (byte)'I':
                r.TF = TimeFrame.Intraday;
                break;

            case (byte)'D':
                r.TF = TimeFrame.Daily;
                break;

            case (byte)'W':
                r.TF = TimeFrame.Weekly;
                break;

            case (byte)'M':
                r.TF = TimeFrame.Monthly;
                break;
            }

            r.Symbol     = rec.Symbol;
            r.Name       = rec.Name;
            r.FileNumber = rec.FileNumber;
            r.FirstDate  = MsFileIO.ConvertDateTime(rec.FirstDate1);
            r.LastDate   = MsFileIO.ConvertDateTime(rec.LastDate);
            return(r);
        }
示例#2
0
 private void LoadToDb(StockDataHeader hdr, string path)
 {
     hdr.Classifier = path;
     if (!_symbolTable.ContainsKey(hdr.Symbol))
     {
         _symbolTable.Add(hdr.Symbol, hdr);
     }
     else
     {
         _symbolTable.Add($"{hdr.Symbol}-{path}", hdr);
     }
 }
示例#3
0
        public PriceDateFile(string dbRoot, StockDataHeader hdr)
        {
            string extension = hdr.FileNumber > 255 ? "mwd" : "dat";

            FileName        = @$ "{dbRoot}\{hdr.Classifier}\F{hdr.FileNumber}.{extension}";