FIDAL - Financial Data Access Library |
|
C/C++ Application Program Interface2.0 How to build and link to FIDAL
1.0 IntroductionAll functions available to the end-user are documented here. FIDAL provides functionality for your application to access market data. It provides a consistent interface to retrieve market data online, from a local database or from local file.
2.0 How to build and link to FIDALTo use the library in C/C++ project, you just need to #include "fidal.h" and link to the static library corresponding to your type of application. All the required header file are in fidal/c/include. Header files in other directories should never be included by your application directly. 2.1 Windows/Microsoft Visual C++Here is the list of variant of the static library currently supported:
Pre-compiled version of these libraries is part of the MSVC package. If you wish to re-build yourself the static libraries, makefiles can be found in fidal/c/make/<ENV>/win32/msvc. To rebuild from scratch do "nmake clean" and then "nmake" again.
2.2 Windows/Free C++ Borland Compiler
2.3 LinuxPre-compiled library are not provided for Linux. You must build these yourself with the makefiles found in fidal/c/make/<ENV>/linux/g++. The <ENV> is a 3 letter sub-directories (cmd,cmr,csd,csr) allowing to select an environment of development applicable to your application (see section 2.1). The cdd and cdr type does not apply to Linux. Just type "make clean" and "make" to build all targets. The generated targets will be found in fidal/c/lib and fidal/c/bin. You need libCurl to be installed (to provide internet access functionality). 2.4 Regression Testing (All Platform)When building the complete source tree, an application called "fd_regtest" is created in the fidal/c/bin directory. This is a suite of tests to validate that the library you did compiled is behaving as expected within your environment. Whenever you re-compile the FIDAL libraries, it is suggested to re-run fd_regtest. An internet connection is required since web data fetching is one feature being tested.
3.0 Accessing Market DataThe interface can be found in fidal/c/include/fidal.h Make sure FD_Initialize is called once (and only once) prior to any other API functions. Once your application is finished with FIDAL, call FD_Shutdown to free all resources. Create one or many unified database with FD_UDBaseAlloc. When not needed anymore an unified database can be freed with FD_UDBaseFree. Data source can be added to an unified database by using FD_AddDataSource. Without adding any data source, an unified database is totally empty! For each unified database, the index of the available categories and symbols can be extract by using respectively FD_CategoryTableAlloc and FD_SymbolTableAlloc. These tables are simply an "array" of strings. Once these index are not needed anymore, they can be freed using FD_CategoryTableFree and FD_SymbolTableFree. The caller can allocate as much tables as needed. By specifying the category and the symbol string, the historical data can be obtained using FD_HistoryAlloc. Once the data is not needed anymore, it can be freed using FD_HistoryFree. The historical data is stored in the structure FD_History. Some listing of the content of the unified database can be done with FD_Report. The report can be sent to the console (stdout) or to a file.
4.0 Time / Date FunctionsBoth date and time manipulated by the FIDAL are encoded within a FD_Timestamp (encoded on 64 bits). Timestamps can cover all dates between the year 1600 to 9999 down to a precision of 1 seconds. You can extract basic information from a FD_Timestamp with:
See fidal/c/include/fd_common.h for more information. |
|