FIDAL - Financial Data Access Library |
| Data ManagementDesign Draft
This document describes some NEW features planned for the data management of FIDAL. Some of the feature discuss in this document are not yet implement. User of the library should read the API document before all. The interface implementation is a C header file c\include\fidal.h
Protection Scheme(not implemented) The goal of a good protection scheme is to provide an alternative source when another fail, but that should never come at the cost of building a time series with doubtful validity. Consequently, it might be better to return data from ONE and ONLY ONE selected data source for a given FD_HistoryAlloc call. The choice of selection logic are:
If after these selection rules, there is still a tie, the first data source who was added with FD_AddDataSource is selected. The user definable ranking is an optional parameter to FD_AddDataSource() and is simply an integer value (higher value means higher ranking). When none of these flag is used, FIDAL performs the data source merging logic. Source Naming(not implemented) Example: /* Display the list of data source that did Only the contributing sources are specified, consequently, you will get more than one source listed only when FIDAL does data merging. Now that data source are named, the user will have the option to name a specific data source when calling FD_HistoryAlloc(), FD_QuoteAlloc() and FD_InfoAlloc(). Example: /* Get data but use exclusively the named data source "CSI" */ The possibility to request from a particular data source is a new feature planned for 0.1.2. Meta-Data(not implemented) Each data source can define their own set of meta-data. In fact, from an implementation point of view, the meta-data requested is quite "transparent" to FIDAL. It is just pass down to each data source "driver" that evaluate if they can resolve or not the requested meta-data. It is obvious that FIDAL usefulness is to eventually get multiple data source to use the same meta-data identifier e.g. "CompanyName" would be understood in the same way by all data source driver. Eventually, a guideline should be written. Example 1: /* Get the company name. */ Example 2: /* Get the earnings. In addition, display which data Example 3: /* Same as previous, but this time get the data from only Data Retrieval Timeout(not implemented) Quote(not implemented) Example:
Begin versus End Timestamp BoundaryFIDAL support two interpretation of timestamps. The user can choose their favorite interpretation (begin versus end period), while the data source can independently provide the data using a begin versus end period. FIDAL will automatically convert the timestamps to the user request interpretation. This functionality is implemented, but not with the most speed efficient approach. The following just provides details of how the code will progressively implement the optimum version. The goal is to minimize the number of conversions. Implementation plan (long term) All "Mix" are about scenario of merging of data source with a mix of begin and end logic. Alias(not implemented) File Format is: Example of Alias File: MyStockList,MSFT,US.NASDAQ.STOCK,MSFT First two lines put IBM and MSFT into your MyStockList category. You are solely responsible to make sure you are using unique symbols in MyStockList. In case of conflict, the last added alias replace the existing alias. A suggestion is to merge the target category and target symbol into being the alias symbol e.g. put in MyStockList the symbols "MSFT@US.NASDAQ.STOCK" and "IBM@US.NYSE.STOCK". Line 3 and 4 shows how someone can build a Sector/Industry list. Line 5, 6 and 7 shows that the category and symbol alias name does not have to be related to the target name at all. Here a list of most active is build using numbers as symbol names. Function will be provided to resolve the "root" of a category/symbols. That way, the user will be able to figure out that "1" maps to LNUX in US.NASDAQ.STOCK. Line 8, 9 and 10 shows another example where lists might be created base on data correlation. This is one of the long term goal of FIDAL to offer such correlation functions. The last line shows how a complete category can be aliased. Here the user will be able to access the same list of symbols using either "NASDAQ" or "US.NASDAQ.STOCK" category. Implementation details: creation/deletion/save/load of alias is mostly under the control of the FIDAL user. This functionality will be also accessible to the FIDAL data source driver. That way, a driver can map the same "data" into multiple distinctive category/symbol naming conventions. Realtime UpdateApproach #1 - Polling (implemented) Approach #2 - Callback on change (not implemented) Approach #3 - Dynamic Update (no implemented, may be never) |
|