FIDAL - Financial Data Access Library |
| Yahoo! Data Source5.0 FD_AddDataSource Parameters Details
1.0 IntroductionYahoo! offers free historical data through internet. This data can be integrated into your unified database using two Yahoo! data sources explain in this document. A small demo application is included (see c/src/demo/fd_yahoo). The makefile is in c/src/make. This tool allows to fetch historical data from the command line. Feel free to enhance or re-use that code in your own application. You can add new symbols to your unified database in two ways: (1) FD_YAHOO_WEB provides automatically an index using the FIDAL category/symbol guidelines. (2) FD_YAHOO_ONE_SYMBOL adds Yahoo! symbols one at the time with a user defined category/symbol. The two data sources type can co-exist. The recommendation is to start with FD_YAHOO_WEB and add the symbols that you find missing with one or many FD_YAHOO_ONE_SYMBOL sources. The advantage of FD_YAHOO_WEB is to have the index all build for you, while FD_YAHOO_ONE_SYMBOL is passing the responsibility to the FIDAL user. If you do not care about having an index, then using only FD_YAHOO_ONE_SYMBOL might be sufficient. Terms Of ServiceData retrieved from Yahoo! must respect their terms of service (see http://www.yahoo.com for the legal details). In short, the data cannot be re-distributed. The FIDAL package does not contain any market data from Yahoo!, so you are solely responsible of the data you retrieve with your application.
2.0 The Yahoo! Index2.1 FD_YAHOO_WEBIn FIDAL, a data source must provide an index. Because Yahoo! does not provide such index directly, one must be build. With FD_YAHOO_WEB the index is automatically accessed and copied from fidalsoft.org (see "Advanced Feature" if you want to re-build that index yourself). With this data source, the symbols DO NOT follow the Yahoo! convention, it is instead map to follow the Category Guideline and the Symbol Guideline. By following this guideline, you have a better chance to be able to switch to other data source without changing your list of stocks. Example: Nortel on the Toronto Stock Exchange on Yahoo! is "NT.TO". When accessing from the FD_YAHOO_WEB data source, it is instead in the category "CA.TSE.STOCK" with the symbol "NT". Because the number of symbols provided by Yahoo! can get very large, the list is decompose into multiple index. Someone wishing to access all available symbols will need to add these smaller index individually with FD_AddDataSource.
Here is an example building the index with both the American and Canadian stocks: FD_AddDataSourceParam param; 2.2 FD_YAHOO_ONE_SYMBOLWith this data source, you can map individual Yahoo! name to a category/symbol of your choice. You provide the Yahoo! name with the info field. The category and symbol can then be optionally specified. If the category field is NULL, the default category name is used ("ZZ.OTHER.OTHER"). If the symbol field is NULL, the info field is going to be used as the symbol. /* Add the symbol to the unified database */ Example(2): To map "2812.TW", which is a Taiwanese stock, to the category "MyTaiwanStocks" and the symbol "Taichung". /* Add the symbol to the unified database */
3.0 Historical DataOnce the data source are added, the historical data can be retrieved like usual with FD_HistoryAlloc. Each call will cause a remote online access, there is no local caching of historical data.
4.0 Advanced Feature4.1 Index Local Caching(This section applies only to FD_YAHOO_WEB) If you want to force FIDAL to use a "fresh" data source from fidalsoft.org, simply erase all the y_xx.dat files on your local drive. 4.2 Building Your Own Index(This section applies only to FD_YAHOO_WEB) It is easy to build your own index as fidalsoft.org do periodically. You just need to use the "gen_rdata" tool. Once all the .dat files are generated, just put these on your local drive cache or within the same directory of your application (see previous section). These .dat files will be used until they expire (~4 days later). Take note that building your own index takes a LOT of time and bandwidth, in fact I simply do not encourage to do that if you do not have a broadband connection. Do "gen_rdata ?" to get the command line options. The easiest is to simply type "gen_rdata -u" to create the index for all the countries at once.
5.0 FD_AddDataSource Parameters DetailsHere are a quick overview of how each FD_AddDataSource parameters are used for the Yahoo! data sources: 5.1 FD_YAHOO_WEB
5.2 FD_YAHOO_ONE_SYMBOL
| |||||||||||||||||||||||
|