コード例 #1
0
        public List <StockNegotiation> ImportFileHistory(string basePath, string fileName)
        {
            var result = new List <StockNegotiation>();

            var path = Path.Combine(basePath, fileName);

            using (StreamReader leitor = new StreamReader(path, Encoding.Default))
            {
                while (!leitor.EndOfStream)
                {
                    var linha = leitor.ReadLine();

                    if (linha.Substring(0, 2) == "00" || linha.Substring(0, 2) == "99")
                    {
                        continue;
                    }

                    var stock = new Stock(linha);

                    var stockNegotiation = new StockNegotiation(linha, stock);

                    result.Add(stockNegotiation);
                }
            }

            return(result);
        }
コード例 #2
0
 public StockNegotiationModel(StockNegotiation stockNegotiation)
 {
     Code              = stockNegotiation.Stock.Code;
     Date              = stockNegotiation.Date;
     FirstValue        = stockNegotiation.FirstValue;
     MaxValue          = stockNegotiation.MaxValue;
     MinValue          = stockNegotiation.MinValue;
     AverageValue      = stockNegotiation.AverageValue;
     LastValue         = stockNegotiation.LastValue;
     BestBuyValue      = stockNegotiation.BestBuyValue;
     BestSellValue     = stockNegotiation.BestSellValue;
     AmountOfTrade     = stockNegotiation.AmountOfTrade;
     AmountOfBonds     = stockNegotiation.AmountOfBonds;
     TotalValueOfBonds = stockNegotiation.TotalValueOfBonds;
 }