Home | Assignments | Journal | Progress | Proposal | Techlab

An Online User Interface for
Tracking Stock Portfolios

Quarter I | Quarter II | Quarter III | Quarter IV

Quarter II

06 November 2002—29 January 2003

Week 1

Goals

  • To continue learning PHP
  • To begin learning MySQL

    Entries

    06 November 2002—Mr. Latimer discussed his expectations for Quarter II, emphasizing the need for extensive coding and the poster. Specific requirements include a minimum of 500 lines of code for the quarter, not including the copious, detailed comments desired, and sample results. New tasks for this quarter are creating a poster that balances technical content and visual appeal and finding a project-related link. Additonally, Mr. Latimer expects preliminary work on the technical paper, a document due upon completion of the project in Quarter IV.

    I reviewed the PHP functions related to MySQL on php.net, noting that mysql_connect and mysql_select_db will be of use in retrieving stock data online, for connecting to a MySQL server and selecting a MySQL database, respectively.

    07 November 2002—Using my freshly minted MySQL account (courtesy of the able, amicable Jeffrey Arnold), I prepared the table and file necessary to establish a proxy connection through which to obtain stock data from Yahoo! Finance. This approach is based on the work done by Thomas Jefferson graduate Gregory Polins. The table Access contains the fields server and port, set to bigbrother.tjhsst.edu and 8002, respectively, by the file access.sql. Connection and database selection occur through the file sql.php, which uses my account and the corresponding database. I plan to obtain stock data in a PHP function in which the groundwork created today is used. Retrieving basic information pertaining to the major American indices will serve as practice for gathering a wider selection of data for specific companies.

    mysql> SELECT * FROM Access;
    +-----------------------+------+
    | server                | port |
    +-----------------------+------+
    | bigbrother.tjhsst.edu | 8002 |
    +-----------------------+------+

    Week 2

    Goals

  • To retrieve data regarding the major American indices
  • To prepare for the portfolio review on 18 November 2002

    Entries

    11 November 2002—I searched the Internet for methods to obtain stock data once a connection is established. In the process, I discovered that MySQL is not necessary in doing so. At PHPBuilder.com, I found sample code for retrieving the current level of a stock through Yahoo! Finance. Also included was a brief discussion of potential errors in obtaining the quote. The PHP function preg_match was used to find a string of the format used in the source of the page produced by Yahoo! Finance when a listing is entered. I will modify and expand this program to handle the unique format of designating indices and to include other data—change from the previous session in points and percent. The indices for which I will obtain data are Dow Jones Industrial (^DJI on Yahoo! Finance), NASDAQ Composite (^IXIC), and Standard and Poor's 500 (^GSPC).

    12 November 2002—I wrote index.php to replace index.html. The new page accomplishes the objective of retrieving data (current level, absolute change, and relative change) about the major indices listed above. In conjunction with fn.php, which contains the function retrieve, index.php creates a table to display the desired values. The data showing changes are in green in the change is positive; red for negative. The retrieving function is based on my findings yesterday, but was substantially modified to obtain additonal data and to account for values that exceed 1000 points. The latter alteration was necessary because Yahoo! Finance inserts a comma in values over 1000, complicating the search for matching strings. Today's work is a substantial milestone in my project, marking the first successful program specifically related to An Online User Interface for Tracking Stock Portfolios. However, my accomplishments today also are merely a prelude to obtaining detailed technical data for companies and corporations listed on the various American indices.

    14 November 2002—I prepared for the portfolio review scheduled for 18 November 2002. Requirements for this first formal evaluation of progress of Quarter II include:

  • Describing current research in supercomputer applications
  • Selection of a topic related to the project for further research
  • Updated accounts of progress, including a status report
  • Commented code with results

    I prepared a progress report for the current iteration, and wrote a separate status report to include other accomplishments necessary for the portfolio check. In addition to the above, Mr. Latimer and I discussed the current status of my project. At this time, I need to continue exploring data-retrieval techniques using PHP. Until I begin to code the user interface, which will require more practice with MySQL, I will continue to display results as appropriate in the techlab section of my website.

    Week 3

    Goals

  • To continue exploring data-retrieval techniques
  • To increase the functionality of current methods

    Entries

    18 November 2002—After adding another component to index.php, a form in which users can enter the ticker symbol of a stock to obtain a quote (as well as change from the opening in dollars and percent, using the same retrieving function as the major American indices) on the resulting page, I volunteered to have my portfolio—the technical term for the collection of webpages pertaining to my project—checked first. I showed Mr. Latimer the components of my work discussed in my status report written specifically for the portfolio check. He viewed the results of Iteration IV and saw the administrative assingments. Additionally, he used the form described above, based on my experience with PHP queries from the tutorial at php.net and later use of the manual on that site. Having quickly expanded the capabilities of my website, I look forward to a productive, intellectually stimulating week.

    Potential enhancements of functionality include obtaining additional data for listings in the various indices (as required by Nick for his comprehenesive analysis) and the ability to obtain data for multiple symbols in the same form.

    19 November 2002—I determined that sending a list of symbols to the function retrieve in fn.php requires extensive revisions of the file. Therefore, I decided to display technical data in addition to those previously shown (current price, and change in price and percent for the current session). Though not as difficult as handling a list of listings for which to obtain data, properly displaying the results involved careful crafting of strings in the function preg_match and properly ordered if, else if, and else statements to display each additional datum with its corresponding verbal description. For instance, in the original function, if a the stock price of a company or corporation increases but the business has no P/E ratio due to negative earnings, the negative number representing earnings is displayed as a decrease in stock price, alongside the number representing the actual increase in that datum. Another element considered in expanding that data available through the form on index.php was format. The strings sought in the preg_match functions were incompatible with my desire to continue displaying results in tables. To maintain a consistent format, I used the function substr, found after searching php.net, I selected only the necessary part of the string for display. The information newly available using the form includes P/E ratio (price to earnings) and PEG (P/E to growth). The abovementioned issue precluded code allowing for additional data to be displayed.

    21 November 2002—I continued to expand the data provided by my form. Additional fields provided in the resulting table are the exchange medium in which the stock is traded—New York Stock Exchange (displayed as NYSE), NASDAQ National Market (NASDAQ), or American Stock Exchange (American)—volume (the number of shares traded) during the current session, average daily volume, and market capitalization (the number of outstanding shares multiplied by price). The unique characters and presence of parentheses in the text near EPS (earnings per share) on the Yahoo! Finance page from which data are retrieved have impeded my efforts to display this critical measure of worth. As for previously added fields, the related issues of obtaining proper strings and properly displaying the data included in those strings were strong considerations in my work. Specific issues included allowing for volumes in the millions and the thousands, and market-capitalization values in the billions and the millions. Also, if the preg_match statements did not obtain a string, N/A was printed into the corresponding field in the table (as opposed to leaving it blank).

    With respect to future tasks, Charles Vu, who is working with models for stock options, and I looked at additional information available on Yahoo! Finance. Of note in our informal analysis of the site was the anticipated difficulty in obtaining historical prices. This observation is pertinent to my project because my concentration on PHP and the Internet will lead to my sending historical prices to a text file for subsequent analysis by Nick. My partner will also require ROA (return on assets) and ROE (return on equity) data, displayed in another section of Yahoo! Finance, in order to conduct his assessments of various models for purchasing and selling stocks.

    Week 4

    Goals

  • To decide on the next step
  • To complete outstanding administrative requirements

    25 November 2002—I conferred with Nick about our progress in the short term. He will continue to code the shell of his program, aware that he may have to revamp it in its entirety. I will work on obtaining historical prices for stocks. The difficulty in this endeavor is retrieving the desired data from tables and handling special occasions such as dividends and splits noted in the tables. Additionally, I updated my journal to include the progress in the previous week.

    26 November 2002—In honor of the Pilgrims, who came to America in search of religious freedom, and their hosts, the Indians, we played a grand Thanksgiving RISK game.

    Week 5

    Goals

    See Week 6 [deferred due to snow day].

    02 December 2002—One element of obtaining historical prices will be storing them in a text file so that Nick can access the data through his program in C++. Therefore, I researched this topic for future implementation in the corresponding retrival function. After this brief visit to php.net, I began to program the function. Given the constraints of time and my unfamiliarity with the newly acquired PHP information, I made minimal progress.

    03 December 2002—In celebration of the impending snow, Mr. Holliman treated us to a movie and snacks.

    05 December 2002—Snow day.

    Week 6

    Goals

  • To discuss objectives for the short term with Nick
  • To formally describe my progress

    09 December 2002—Nick and I talked about our progress to date and our plans for the closing weeks of Quarter II. Given the abundance of administrative requirements that typically accompany the end of a quarter, we decided to subjugate coding progress to the non-programming elements of a project. Progress reports, research in a selected topic pertinent to the project, and the poster describing the project are expected to take precedence as we approach the midway point of the academic year.

    10 December 2002—I wrote a progress report for Iteration V, in which I retrieved a variety of information regarding listings on the major American indices in a user-filled form.

    12 December 2002—I continued coding the retriever for historical prices. Given the multiple columns of data stored in Yahoo! Finance's tables of historical prices, it is difficult to ascertain what data are desired for storage.

    Week 7

    Goals

  • To begin work on administrative and non-coding assignments
  • To continue coding to retrieve historical prices

    09 December 2002—I began preparing for the poster, finishing the title, abstract, and introduction for this major project of Quarter II. Although the interface is incomplete, my vision for the final result will assist in creating content for the remainder of the poster.

    17 December 2002—Mr. Latimer reviewed my portfolio, finding all requirements complete for his mid-quarter evalutation. He advised me to think of potential visuals for my poster and to continue exploring related research, connecting my studies specifically to my project. Mr. Latimer also informed me that his father, a resident stock expert, will be testing my project.

    Weeks 8-10

    Goals

  • To plan and create the project poster
  • To complete other administrative requirments as needed

    06 January 2003—I continued work on the poster, taking care to meet the requirements specified by Mr. Latimer.

    07 January 2003—I began exploring possible visuals for use in the poster. My options are limited because the project is yet incomplete.

    10 January 2003—I worked on the placement of specific sections of my content on the poster, in addition to considering various color schemes.

    13 January 2003—I modified my content based on the personalized recommendations of Mr. Latimer, attempting to avoid vague and unnecessarily complex phrases.

    14 January 2003—I commenced physical construction of the poster, preparing backings for the several sections of content.

    16 January 2003—I enlarged the text of the content so that excessive "white" space is covered upon completion of the poster. This modification consequently required cutting new backings and textual sections.

    21 January 2003—I considered the options for arrangement with the new sections and discussed my plans with Mr. Latimer. I followed his suggestion to add captions that relate the graphics to the project.

    23 January 2003—POSTER COMPLETE!

    Week 11

    Goals

  • To finish any outstanding requirements
  • To create a digital version of my poster

    28 January 2003—Using nested tables, I created an online version of my poster. It appears as Iteration VI.

    29 January 2003—I ensured that Mr. Latimer has updated information on my project. He approved of having a single page on which to display the online poster, given the high accuracy of my design in replicating the hard copy.

    Home