Exemple #1
0
 private void CacheStocks()
 {
     UpdateCache(GetKey("symbols", "StockSummarys"), () =>
     {
         List <StockSummary> stocks = Stocks.GetStocksFromYahoo(string.Join(",", Symbols));
         Serialize <List <StockSummary> >(GetPath("symbols", "StockSummarys"), stocks);
     });
 }
Exemple #2
0
 private void CacheStock(string symbol)
 {
     UpdateCache(GetKey(symbol, "StockSummary"), () =>
     {
         StockDetails stock = Stocks.GetStockFromYahoo(symbol) as StockDetails;
         Serialize <StockDetails>(GetPath(symbol, "StockSummary"), stock);
     });
 }
Exemple #3
0
 private void CacheStockHistory(string symbol, DateTime start, DateTime end)
 {
     UpdateCache(GetKey(symbol, "StockHistory"), () =>
     {
         List <StockSummary> stocks       = Stocks.GetStockHistoryFromYahoo(symbol, start, end, "d");
         List <StockDetails> stockDetails = new List <StockDetails>();
         foreach (StockSummary s in stocks)
         {
             stockDetails.Add(s as StockDetails);
         }
         Serialize <List <StockDetails> >(GetPath(symbol, "StockHistory"), stockDetails);
     });
 }