For many applications, data is stored in a database as a time series of data values. The data retrieved from the database may need to be adjusted for events. In particular, it may be desirable to apply an interval-based adjustment (IBA) to the data.
Examples of interval-based adjustments include the application of stock splits and currency conversions. Such adjustments may also be used to reflect dividend distributions from stocks and mutual funds. These adjustment triggers are typically infrequent events.
To reduce rounding and precision errors, the time series data is typically stored as unadjusted data values. When the data is stored in its unadjusted form, the data would be adjusted on retrieval to reflect the adjustments. For example, on retrieval of stock prices, one may like to see all data adjusted based on the current price taking into consideration the stock's split and dividend history. Using the adjusted data, the performance of the security over time can be accurately ascertained and presented to the user. Typically, the adjustments are applied using custom programming.
The custom programming approach has at least two disadvantages. In the first place, each installation may have to write custom programs to solve the problem. This need to develop custom code for each database increases development costs. In addition, the performance of the resulting custom program tends to be slow. A contributor to the slow performance is the use of multiple scans of the data to first retrieve the data and then to apply any adjustments. Another contributor is the additional memory overhead to store the date while it is being processed.
A better approach exploits the high performance of a database engine. The database engine can retrieve and apply the appropriate adjustment factors for each data element in a time series. In particular, the database engine is a relational database engine. From a user's perspective, the adjustment can be applied transparently.
In a particular embodiment, a database stores a plurality of raw data values organized as a series in a first database structure. The data can be a time series of data, such as financial data. A plurality of intervals of adjustment data are stored in a second database structure. The adjustment data includes an adjustment value for each interval. Furthermore, the adjustment values can be dynamically updated to reflect additional intervals of adjustment data being added to the database.
For a user to query the database for adjusted data values, the first and second database structures are associated. This can be done by creating a view of the database that includes the two structures. This can be done by a system administrator. The user query then applies the adjustment values to the raw data values to yield adjusted data for presentation to a user.
The database can also store data for pending adjustments. In particular, the second database structure can include adjustment data for the pending adjustment. In response to a query for adjusted data using the pending adjustment, an adjustment value for each interval can be computed using the pending adjustment data and applied to the raw data values.
The foregoing and other objects, features and advantages of the system will be apparent from the following more particular description of embodiments, as illustrated in the accompanying drawings in which like reference characters refer to the same parts throughout the different views. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention.
Embodiment of the system can be practiced on various time series data models, including, but not limited to, stock splits, dividend distributors, currency conversion, and expense adjustments. For ease and clarity of description, the system will be described with reference to stock splits.
As an example of a forward-looking adjustment, a user may want to determine the current value of a share of stock purchased on a particular date, D1, D3, D5. A share purchased on the first date D1 at $30/share would have a value of $30 on that date, D1. At a subsequent date D3, the stock closed at $80/share. Because of the 3-for-1 split on the first split date D2, the user would have 3 shares, instead of 1, valued at $240. The investment has increased 8-fold. At a still later date D5, the stock closed at $50/share. Because of the 3-for-1 split on the first split date D2 and the 2-for-1 split on the second split date D4, the user would have 6 shares, valued at $300. The investment has now increased 10-fold. From the adjusted data, the user can determine the gain of the investment over time.
One example of adjusting backward in time is a moving average. The discontinuity created by the splits should be adjusted to obtain an accurate moving average. To obtain adjusted data, the prices between the split dates D2, D4 is divided by the second split factor, 2. For example, the stock at date D3 is valued at $40/shore in the current valuation. Price data before the first split date D2 is divided by the first and second split factors, 3*2=6. For example, the stock at date D1 is valued at $5/share in the current valuation.
The server 10 can be a single computer or a plurality of clustered computers. The server 10 includes an operating system (OS) 12 and a database engine 14 layered over the operating system 12. Together the operating system 12 and the database engine 14 cooperate to manage a database 16. In particular, the database 16 is a relational database that stores time-series data and the database engine 14 is Oracle8i, commercially available from Oracle Corporation, Redwood Shores, Calif.
The database 16 can include three relational database table structures. A map table 18 maps a reference symbol to an adjustment table 19. In the particular example described below, the time-series data is daily raw (i.e., unadjusted) stock price data and the adjustments are stock splits. For this example, the reference symbol is a stock ticker symbol. The map table 18 thus maps the ticker symbol to splits table 19.
Database queries can be initiated by a client computer 20a. The server 10 uses the database engine 14 to retrieve data from the database 16 to satisfy the query. Results are returned to the client computer 20a for display to a user. These results are automatically adjusted using data from the adjustment table 19.
Methods for applying the adjustment data exploit the high performance of the relational database engine 14 to retrieve and apply the appropriate split factor for each element in a pricing time series. Furthermore, from the user's perspective, applying the split factor is performed transparently.
The map table 18, as shown, includes two fields: a symbol character field 18-1, and an adjustment table field 18-2. The symbol field 18-1 stores the stock ticker symbol. The adjustment table field 18-2 can be a text field or a pointer field that dereferences to the splits table 19 for the stock identified in the symbol field 18-1.
The splits table 19, as shown, includes five fields. Each record in the splits table 19 is associated with one interval. An effective_date date field 19-1 records the effective date of an adjustment (split) and an end_date date field 19-2 records the date of the next split adjustment. The split information for the interval between the effective date and the end date is recorded in the numerator integer field 19-3 and the denominator integer field 19-4. The factor value to convert prices during this interval period to current valuations is stored in the factor numeric field 19-5.
Every time a new entry is entered into the splits table 19, reflecting a new split, the factor field 19-5 for each entry is recalculated. The factor is computed from the cumulative products of the numerators and denominators as follows:
where i is the entry position in the splits table 19, beginning from 1; and
N is the total number of entries in the splits table 19.
In a particular embodiment, the recalculation of the factor fields 19-5 are performed by the database engine 14 (
After the first (3-for-1) split, the splits table 19 is illustrated by
After the second (2-for-1) split, the splits table 19 takes on its final form, as also illustrated by
Structured Query Language (SQL) queries reference the splits table 19 and the stock table 17 to automatically perform price adjustments. This price adjustment is implemented with a view, which allows the transparent application of the adjustments. The SQL query makes use of the effective date field 19-1 and the end date field 19-2 to automatically and efficiently apply the appropriate split factor upon retrieval of the price date. In particular, the effective and end date columns 19-1, 19-2 are used in retrieval queries' WHERE clause to select the appropriate price adjustment from the splits table 19.
In a particular embodiment using Oracle8i, the splits table 19 is implemented as a nested table (SplitSeriesTab) of records (SplitSeriesCells). The queries posed by the user to retrieve data adjusted for splits are expressed almost identical to a SQL query that would retrieve unadjusted data. Specifically, to retrieve data adjusted for splits, the user substitutes the name of the underlying table holding the pricing data with a view. That is, the
The view that accomplishes the adjustment for the price table having high and close pricing columns is:
Pricing data selected from the stock table 17 is adjusted by:
An administrator may also want to insert “pending splits” into the splits table. Pending splits are those that have been announced but have not yet become effective.
The previous solution relies on a split factor column that is always current, that is, the split factor column must be recomputed prior to the first retrieval of unadjusted data on or after the effective date of a new split.
There are many ways to enforce this property, such as:
Below is an alternative solution that handles pending splits, but does not require additional maintenance scripts. The solution is based on a view that recomputes the proper split factors based on the current date:
Here, SYSDATE is the current date/time of the computing system. This view is similar to the previous view, but extended with a subqueury. The subqueury computes the cumulative product of numerators and denominators from the splits table.
It may also be desirable to apply multiple interval-based adjustments to time series data. For example, a stock price may be adjusted due to both splits and distributions. The database engine 14 can handle these multiple adjustments, either in parallel or series. First, the map table 18 can have more than one column per stock, one dereferencing to the splits table and another dereferencing to the distribution table. To apply the adjustments in parallel, a view can be created using the multiple adjustment tables. Applying the adjustments in series may be more difficult because the adjustments should be applied in time order.
Those of ordinary skill in the art will recognize that methods involved in the interval-based adjustment system may be embodied in a computer program product that includes a computer usable medium. For example, such a computer usable medium can include a readable memory device, such as a solid state memory device, a hard drive device, a CD-ROM, a DVD-ROM, or a computer diskette, having computer readable program code segments stored thereon.
While this system has been particularly shown and described with references to particular embodiments, it will be understood by those skilled in the art that various changes in form and details may be made without departing from the scope of the invention encompassed by the appended claims.
Number | Name | Date | Kind |
---|---|---|---|
551024 | Wright | Dec 1895 | A |
5220500 | Baird et al. | Jun 1993 | A |
5267348 | Someya et al. | Nov 1993 | A |
5347452 | Bay, Jr. | Sep 1994 | A |
5412769 | Maruoka et al. | May 1995 | A |
5414838 | Kolton et al. | May 1995 | A |
5446575 | Lysakowski, Jr. | Aug 1995 | A |
5454104 | Steidlmayer et al. | Sep 1995 | A |
5594898 | Dalal et al. | Jan 1997 | A |
5630070 | Dietrich et al. | May 1997 | A |
5761386 | Lawrence et al. | Jun 1998 | A |
5774878 | Marshall | Jun 1998 | A |
5778371 | Fujihara | Jul 1998 | A |
5873091 | Garth et al. | Feb 1999 | A |
5946666 | Nevo et al. | Aug 1999 | A |
5966139 | Anupam et al. | Oct 1999 | A |
6026381 | Barton et al. | Feb 2000 | A |
6029146 | Hawkins et al. | Feb 2000 | A |
6094650 | Stoffel et al. | Jul 2000 | A |
6108004 | Medl | Aug 2000 | A |
6125105 | Edwards et al. | Sep 2000 | A |
6163781 | Wess, Jr. | Dec 2000 | A |
6195103 | Stewart | Feb 2001 | B1 |
6243696 | Keeler et al. | Jun 2001 | B1 |
6256628 | Dobson et al. | Jul 2001 | B1 |
6272332 | Matsumoto et al. | Aug 2001 | B1 |
6272474 | Garcia | Aug 2001 | B1 |
6317728 | Kane | Nov 2001 | B1 |
6321212 | Lange | Nov 2001 | B1 |
6338067 | Baker et al. | Jan 2002 | B1 |
6401091 | Butler et al. | Jun 2002 | B1 |
6415268 | Korisch | Jul 2002 | B1 |
6553383 | Martin | Apr 2003 | B1 |
6709330 | Klein et al. | Mar 2004 | B1 |
6731990 | Carter et al. | May 2004 | B1 |
6742150 | Ghameshlu et al. | May 2004 | B1 |
6751597 | Brodsky et al. | Jun 2004 | B1 |
6754657 | Lomet | Jun 2004 | B2 |
6810414 | Brittain | Oct 2004 | B1 |
6850906 | Chadha et al. | Feb 2005 | B1 |
6975996 | Lawrence et al. | Dec 2005 | B2 |
20010025264 | Deaddio et al. | Sep 2001 | A1 |
20010034701 | Fox et al. | Oct 2001 | A1 |
20020004774 | Defarlo | Jan 2002 | A1 |
20020032696 | Takiguchi et al. | Mar 2002 | A1 |
20020099636 | Narumo | Jul 2002 | A1 |
20020099640 | Lange | Jul 2002 | A1 |
20030120577 | Sakui et al. | Jun 2003 | A1 |
20040128225 | Thompson et al. | Jul 2004 | A1 |
Number | Date | Country |
---|---|---|
0897149 | Feb 1999 | EP |
WO9932999 | Jul 1999 | WO |
WO 0115079 | Mar 2001 | WO |
WO0146771 | Jun 2001 | WO |
WO 2004084092 | Sep 2004 | WO |
WO 01077963 | Oct 2004 | WO |
WO2005077123 | Aug 2005 | WO |