Ejemplo n.º 1
0
        public IActionResult WatchlistHistorical(string watchlistname, DateTime date)
        {
            string name  = User?.Identity.Name;
            var    email = HttpContext.User.FindFirst(ClaimTypes.Email)?.Value;


            if (string.IsNullOrEmpty(watchlistname))
            {
                return(new BadRequestResult());
            }
            ObservableCollection <Quote> Quotes = new ObservableCollection <Quote>();

            Watchlist watchlist = Data.MongoDBDataAccess.Watchlist(name, watchlistname);

            if (watchlist == null)
            {
                return(new NoContentResult());
            }
            //Some example tickers
            foreach (Stock ticker in watchlist.Symbols)
            {
                Quotes.Add(new Quote(ticker.ToString()));
            }

            YahooStockEngine.FetchHistorical(Quotes, date);
            return(new JsonResult(new WatchlistQuote()
            {
                Quotes = Quotes, Watchlist = watchlist
            }));
        }
Ejemplo n.º 2
0
 public void GetHistoricalQuotes(string ticker)
 {
     YahooStockEngine.FetchHistorical(HistoricalQuotes, ticker);
 }