FIDAL - Financial Data Access Library

  Home | Documentation | Download
 

 

FIDAL User FAQ

What is FIDAL?
What is the unified database?
How is the data accessed?
How are the split/dividend handled?
Which data source are supported by FIDAL?
What happen if the same symbol is provided from multiple data source?
Is the library multithread safe?

horizontal rule

What is FIDAL?

The financial data (open/high/low/close/volume/open interest) is the input common to most trading application software. This data is sold and distributed in a variety of ways. Changing of data source provider means often to change your software for a new API.

FIDAL intent is to provides a consistent interface regardless of the data source format (online Yahoo!, Metastock, AIQ, CSU, TC2000, ASCII...).

FIDAL also provides price transformation such as changing minute price bar to weekly.

For anyone doing serious investment/research, it is strongly suggested to use a commercial data provider. FIDAL provides ways to get free online data from the internet, but you get what you pay for...

horizontal rule

What is the unified database?

From the point of view of the FIDAL user, all the data source are merged within ONE virtual database. Each of the instrument gets an entry in this database regardless of which data source it is coming from.

The library takes care to eliminate dependency with the underlying data source. The data is not copied in "yet another format", it is instead read on-the-fly from all the different data source part of the unified database.

The unified database provides access only to price bars. The volume and the open-interest can be also stored for each bar. Although it could be tempting to store more information this projects currently focus only on price market data.

horizontal rule

How is the data accessed?

See the API Documentation :

#include <stdlib.h>
#include <string.h>
#include "ta_libc.h"
int main( void )
{
   FD_UDBase   *unifiedDatabase;
   FD_History  *data;
   FD_RetCode  retCode;
   FD_AddDataSourceParam addParam;
   FD_HistoryAllocParam  historyParam;

   unsigned int i;

   /* Initialize the access to the library. */
   if( FD_Initialize() != FD_SUCCESS )
      exit( -1 );

   /* Create an unified database. */
   if( FD_UDBaseAlloc( &unifiedDatabase ) != FD_SUCCESS )
   {
      FD_Shutdown();
      exit( -2 );
   }
   /* Indicate where to get the data and put it in
    * the "US.NASDAQ.STOCK" category. By default
    * the name of the file determine the name of
    * the symbol. (Wildcards '*' can be used to 
    * include multiple files/symbols in one call).
    */
   memset( &addParam, 0, sizeof( FD_AddDataSourceParam ) );
   addParam.id = FD_ASCII_FILE;
   addParam.location = "c:\\my_data\\LNUX";
   addParam.info = FD_DOHLCV;
   addParam.category = "US.NASDAQ.STOCK";
   retCode = FD_AddDataSource( unifiedDatabase, &addParam );

   /* Now, display all daily close price available
    * for the LNUX symbol.
    */
   if( retCode == FD_SUCCESS )
   {
      memset( &historyParam, 0, sizeof(FD_HistoryAllocParam) );
      historyParam.category = "US.NASDAQ.STOCK";
      historyParam.symbol   = "LNUX";
      historyParam.period   = FD_DAILY;
      historyParam.field    = FD_CLOSE|FD_VOLUME;      
      retCode = FD_HistoryAlloc( unifiedDatabase, &historyParam, &data );

      if( retCode == FD_SUCCESS )
      {
         for( i=0; i < data->nbBars; i++ )
            printf( "%f %d\n", data->close[i], data->volume[i] );
         FD_HistoryFree( data );
      }
   }

   /* Clean-up and exit. */
   FD_UDBaseFree( unifiedDatabase );
   FD_Shutdown();

   return 0;
}

[Back to top]

horizontal rule

How are the split/dividend handled?

The unified database assume all the data source are split adjusted to the latest date. If the data source provides split/adjustment information, the user can choose to retrieve adjusted or non-adjusted data.

[Back to top]

horizontal rule

Which data source are supported by FIDAL?

See List of Data Source

[Back to top]

horizontal rule

What happen if the same symbol is provided from multiple data source?

All the data source belonging to the same unified database are always merged together. The order in which the data source where added with FD_AddDataSource did determined which data takes precedence on the other. The first added data source is the "least important" one, and the data provided by the last one cannot be override by the others.

Example 1: You have a local database and you want an online data source to provide the missing data. You will add the online data source last. 

The merging is independently performed down to each price bar. Think about it... that's a lot of flexibility for managing your data!

Example 2: You have a local read-only CD with an error on a couple of price bars. You can "cover" the erroneous data by putting the correct price bars in a file on your hard disk. Build the unified database by adding first the CD data source and then add the hard disk data source. That way, the price bars from the hard disk data will override the wrong price bar from the CD. This will effectively correct the error.

[Back to top]

horizontal rule

Is the library multithread safe?

Yes. The makefiles generates both a single thread and multi-thread static library.

[Back to top]

Google  SourceForge Logo
  Web FidalSoft.org
 

Copyright? 2006 TicTacTec LLC. All Rights Reserved. Last Update: 07/21/06, Unique Visitor: