In this example I wrote a program to pull historic stock data from the ticker “DIS” over the past 10 days from the current date (it will be less than 10 results because weekends don’t have data). I used the .NET Framework WebClient object to request and return the data as a string that I parse into a generic Dictionary. It pulls the data from Google’s finance website as well as Yahoo’s finance site. Of course, check out their terms of use before doing anything with the code. Here is the code that I wrote on my GitHub. I created a class to handle communication with Google’s and Yahoo’s CSV export links. It handles constructing proper links as well as requesting the data and parsing it into a Dictionary that is structured by date. From that point, you could build an application around the use of that data, but for this example we just translate it back into strings for display in text boxes. public class WebClientForStockFinanceHistory { WebClient webConnector; // See Google...
Computers, programming, software development, AI, design, and more!