October 16, 2006
If you ever wondered how to combine two databases into one this short article will show you how, but let us start with some background first…
A database (or a workspace) is a directory that holds a set of binary files, which are stored in 0-9, a-z, ‘_’ subdirectories. Those binary files hold quotes, symbol information, your studies (trend lines, Fibonacci stuff). Each symbol’s information is stored separately in the file with the name of the ticker symbol located in the subdirectory corresponding to the first character of the symbol, so IBM quotation data/studies are stored in the ‘IBM’ file located in the ‘I’ subdirectory (more information on this in the User’s Guide).
In addition to these subdirectories and files, two additional files are also created by AmiBroker: broker.workspace and broker.master. The first is used to store category names and information about advancing/declining/unchanged issues. The latter stores the table of all symbols that is used for quick loading of the database. These two files are located in the root directory of each database, the ‘data’ directory, by default.
So – if one wants to combine two separate databases – there are the following possibilities:
- Export quotations from one database to the ASCII files and reimport quotes from another database (export procedure is described in the following article in the Knowledge Base http://www.amibroker.com/kb/2006/03/04/how-to-export-quotations-from-amibroker-to-csv-file/ )
- Just copy the data-files from one database folder into another (and place the files in their respective subfolders to keep the database structure the same). Then – it’s also necessary to delete the broker.master file from the target database – as a result AmiBroker will recreate the symbol list at startup and include all the new symbols in the database.