Performance Module:Database
From ExtractValue Wiki
Contents |
Performance Array
This is the actual performance data that the calculations are being performed on. See below for how the performance array is structured.
$config['performance'];
The performance array must be structured as an 8-dimensional associative array that includes the following in each dimension:
/* Dimension: 1 - Year 2 - Month 3 - Day 4 - Hour 5 - Minute 6 - Second 7 - Microsecond 8 - Performance */ // Note: 'xxx' is arbitary and will be replaced with actual values in the actual array. array( '2006' => array( '1' => array( '1' => array( '00' => array( '00' => array( '00' => array( '00' => array( 'rate' => 'xxx', 'value' => 'xxx', 'aum' => 'xxxx', 'interval' => 'xxxx' ) ) ) ) ) ) ) )
Although the performance keeps tab up to a millisecond, not all records are as such. Some records might be monthly, some might be daily or even yearly. In that case, only the available time is placed in the array and subsequent time is replaced with '-1' values in place of actual values.
For example, if a fund only provided performance data for 2007 at 14% and 2008 at 34%, the array would only have two records that look like this:
$performance[2007][-1][-1][-1][-1][-1][-1] = array( 'rate' => 14, 'interval' => 'Year' ); $performance[2008][-1][-1][-1][-1][-1][-1] = array( 'rate' => 34, 'interval' => 'Year' );
Data Formats
There should be these types of raw data to be inputted:
- c_time: Date & Time
- Value: Current value of the Product. By default, value will be denominated in U.S. Dollars.
- Open: Opening price in a time interval
- High: Highest price in a time interval
- Low: Lowest price in a time interval
- Close: Closing price in a time interval
- Rate: Rate of Return
- AUM: Assets Under Management, the amount invested or total value of a given investment
- Volume: the amount of assets transacted
- Status: (0,1) to indicate the status of the data. Data should never be deleted.
Current Code as of 23:03, 21 October 2008 (UTC)
`pk_performance_id` int(50) NOT NULL auto_increment,
`fk_product_id` int(50) NOT NULL COMMENT 'Associated product ID',
`time` int(11) NOT NULL COMMENT 'micro-timestamp',
`interval` enum('1','2','3','4','5','6','7','8') NOT NULL default '8' COMMENT '1:Yearly, 2:Monthly, 3:Daily, 4:Hourly, 5:Minute, 6:Second, 7:Millisecond, 8:Unknown',
`value` float NOT NULL COMMENT 'Normalized VAMI',
`rate` float default NULL COMMENT 'Rate of return',
`aum` float default NULL COMMENT 'Quantity under management',
PRIMARY KEY (`pk_performance_id`),
KEY `fk_performance_product` (`fk_product_id`)
Date & Time
Please see this article for specs.
v.0.8 - it will be stored as micro-timestamp
Assets
By default, assets will be denominated in Millions of U.S. Dollars. For example, 0.1 will be $100,000.00.
However, no asset inputted by a user should exceed $100 billion, which is $100,000 millions. If a user inputs more than $100 billion, give the user an error message which asks "Did you mean $# million?" with # = the value they entered divided by 1,000,000.
For example, if a user had assets of $10,000,000 and mistakenly entered $10,000,000 (which, if denominated in millions would be $10 trillion), then display an error message "Did you mean $10 million?" In this case, # = 10.
Volume
Volume is the amount of assets traded in an interval of time. This will be reported in formats that will vary per investment market or investment vehicle. For example, stocks will report volume in shares while in commodities, they will be reported in futures contracts. Regardless, the number is numeric and a whole number.
Data Feeds
One of Extract Value's data vendors is Xignite. They charge per hit. A hit is defined as each data point requested except for historical data. Historical data is data not from today (yesterday and back).
Extract Value will pull data from Xignite every 10 minutes.
The data fields should contain the following information:
- Name - product name
- Value - the value of the product
- Tick_date - micro-timestamp
- C_date - micro-timestamp
- Volume - the amount of shares/units trades
For detail depending on the actual web serviced used to retrieve the data feed from data broker (xignite), please check here.
NoteThe following information should be added to the product table
- volume_type - id to a foreign table to indicate what kind of volume unit the product uses
- value_type - id to a foreign table to indicate what kind of value unit the product uses
Data Fields
For Product fields, please see Product:Database
| Yahoo Column | Yahoo Column Name | Correlo Column? | Database |
| d1 | Last Trade Date | Date/time | Perf |
| g | Day's Low | Low | Perf |
| h | Day's High | High | Perf |
| l1 | Last Trade (Price Only) | Value | Perf |
| o | Open | Open | Perf |
| p | Previous Close | Close | Perf |
| t1 | Last Trade Time | Date/time | Perf |
| v | Volume | Volume | Perf |
| e1 | Error Indication (returned for symbol changed / invalid) | Status | Product |
| i | More Info | Description | Product |
| n | Name | Product Name | Product |
| n4 | Notes | Description | Product |
| s | Symbol | Exchange Symbol | Product |
Notep is the Close on the last trading day. DO NOT label this as the current day's close. The last trading day is not necessarily yesterday. For example, there may be a Holiday or a weekend, so the last trading day could be two or more days ago.
