After a week of hard work, the new version of little intelligence was finally completed on schedule.
In this version, apart from the large transformation of the underlying object model, more importantly, it began to support the software's function of Automatically Obtaining stock data from the Internet. Currently, you can obtain the transaction information of the current day from Yahoo! and Sina, as well as historical data from analyst websites.
The stock data of Yahoo and Sina is provided in the form of HTML pages, so my program only needs to download the corresponding page, in addition, you can use a regular expression to match each item of stock information. For example, the following code is used to extract the data items of each stock from the Sina page: qregexp rx ("<tr bgcolor = (? :/S +) align = center> <a name = (/S +)> </a> (. + )(? = </Tr> )");
Rx. setminimal (true );
Int Pos = 0;
While (Pos = Rx. indexin (mreceiveddata, POS ))! =-1 )...{
Processforonestock (RX. CAP (2 ));
Pos + = Rx. matchedlength ();
}
The daily data provided by the analyst's website is a data file compressed into a zip file. I used a third-party ZIP file parsing class to extract the original file and then read the binary file, to obtain the corresponding stock data, and now it can achieve stable extraction of its data.
In the next step, in version 0.03 of "Little intelligence", the function of automatically updating data at regular intervals will be supported, and the current K-line chart display screen will be transformed to improve its efficiency.
Http://code.google.com/p/tcstock