I have always had difficulty with stock quotes listed in the newspaper. A single daily stock quote tells me very little. If I look at one of the financial newspapers, I find stock quotes plotted over time, but the stock that interests me is not always available. So I subscribed to the Prodigy Network for the exclusive purpose of downloading stock quotes, appending them to a database file and plotting them. You can download stock quotes from other telecommunications services such as CompuServe.
The new version of Prodigy lets you print your stock quotes to a file. An example of the resulting text file (STOCK.TXT) is as follows:
The program STOCK.PRG procedure appends the STOCK.TXT text file to the STOCK1.DBF database file. Stock quotes are presented as a whole number plus a fraction of a quote. These are converted to a decimal number. For example, 12 1/4 is converted to 12.25. Mutual fund values are presented as a decimal number so no conversion is necessary. The contents of STOCK1.DBF is appended to the STOCKS.DBF database file which contains the stock quotes that have accumulated over a period of time.
A third database file, PORT.DBF contains a record for each stock symbol which contains fields such as the stock symbol, the name of the stock and the number of shares in the user's portfolio. The stock symbols from PORT.DBF are copied to an array and used to identify the quotes that are extracted from the STOCK1.DBF text file and to choose stocks for plotting.
The final function of STOCK.PRG is to execute the PLOT.PRG program to plot the stock quotes. Each Stock is plotted over time. One line displays for each daily stock quote. A white bar displays the value of the stock at the end of the trading day. A yellow bar indicates the daily trading range for the day. At the right of the screen, a brown bar indicates the daily volume. The three columns that display at the left of the screen are the stock price, the dollar portfolio value, and the date.
About the Author:
Jeb Long is the author of JPLDIS, the language that dBASE and FoxPro grew out from. Currently his is the author of FoxPro 2.5 Developers Guide being published from Prentis Hall. Jeb was the Chief Database Architect at Ashton Tate during the dBASE IV development project.