{"id":1296,"date":"2007-10-19T00:27:21","date_gmt":"2007-10-19T00:27:21","guid":{"rendered":"http:\/\/www.amibroker.org\/userkb\/2007\/10\/19\/database-management-faqs\/"},"modified":"2008-03-03T11:27:24","modified_gmt":"2008-03-03T11:27:24","slug":"database-management-faqs","status":"publish","type":"post","link":"http:\/\/www.amibroker.org\/editable_userkb\/2007\/10\/19\/database-management-faqs\/","title":{"rendered":"Database Management FAQ’s"},"content":{"rendered":"
An unsorted, unqualified list of FAQ’s relating to anything and everything to do with database management.<\/p>\n
The list is dynamic and subject to change without notice.<\/p>\n
<\/p>\n
Q6 (a). What happens when my original (MS) data source adds, or deletes, a stock code or merges two codes together? A6. Use the METASTOCK PLUGIN http:\/\/www.amibroker.com\/guide\/h_extsources.html<\/a> to read the MS database directly (so you don’t need to re-import all the time).<\/p>\n Re: understanding categories.<\/p>\n Categories are NOT folders (like in Windows Explorer). The difference is fundamental. In the Explorer a file appears (usually) only once in the given There are two types of categories:<\/p>\n 1. with mutually exclusive membership: groups,markets, sectors\/industries – it means that symbol MUST belong to ONE group, ONE market, and ONEsector\/industry at a time – you can move the symbol from one group\/market\/sector\/industry to another but you can not remove this assignment – create "Unassigned" group\/market\/sector\/industry instead. Another thing: if you use "DELETE" button in Symbol->Categoriesit displays the warning:"This will delete selected symbols FROM THE DATABASE".Again: it will delete FROM THE DATABASE, not from the category.<\/p>\n Tomasz Janeczko – amibroker.com<\/p>\n Authors comments: As a rule of thumb, where data is accessed directly from an external source, WITHOUT a local (AmiBroker) database enabled, changes made to the database by the provider will be reflected at the AB user interface.<\/p>\n Where data is accessed from an external source, WITH a local (AmiBroker) database enabled, database changes will be at the discretion of the user. Depending on the access method, new symbols will be automatically added to the database e.g. when using the MS plug-in, and redundant symbols, or symbols that change, will remain in the database (with their data). The user has the option to merge changed symbols or delete old symbols (the symbol lists are stored in the local AmiBroker database, independently of the plug-in).<\/p>\n Where a local AmiBroker database is used as a standalone (data is updated via AmiQuote) the user has complete control over which symbols to add and delete etc (once again redundant symbols, and their data, will remain in the database unless manually deleted).<\/p>\n Q6 (b). How can I merge two symbols together after a name change?<\/em><\/strong><\/p>\n A6 (b). Pick the symbol, that you want to retain in the database (master symbol), from the All symbols<\/em> list and select Symbols >> Merge<\/em> from the AB file menu. Click on the symbol, that you want to assimilate into the master, from the drop-down list in the Merge quotes<\/em> window that opens, select from the options available (overwrite duplicate quotes, delete the slave symbol after assimilation or assign an alias name) and then click on OK.<\/p>\n <\/p>\n Q5. Does anybody know how to check the number of stock symbols in a database?<\/em><\/strong><\/p>\n A5. Hover the mouse pointer over the Data information<\/em> section of the AmiBroker Status Bar<\/em> (in the bottom right of the AB screen). A tool-tip will report on the database file name and path, the number of symbols in the database and the number of quotes in the current symbol. <\/p>\n <\/p>\n Q4. Currently, my EOD data is supplied in Metastock format from an external supplier (JustData)…how can I setup to use it in AmiBroker? <\/strong><\/em><\/p>\n It is stored in the following folders\/directories on my pc: At the moment I trade multiple exchanges (ASX, LSE) as shown above. However, when it comes to creating the equivalent databases in Amibroker, how would others recommend I create them?<\/em><\/strong><\/p>\n For example, would I need a different Amibroker<\/em> Database<\/em> for: If option 3 is suitable, then how would I distinguish in Amibroker which exchange a security belongs to (LSE or ASX)?<\/em><\/strong><\/p>\n A4. Authors comments – AmiBroker<\/em> doesn’t provide for easy ways to reference symbols that are in one database from within another, so with that restriction in mind it depends on how you want to use the data. If you are going to cross reference World indices to local or international markets, then you would be better off merging them into one database. This takes some work, so if you are not going to do inter-market analysis it is a matter of personal choice whether the benefits are worth the effort.<\/p>\n From an organizational point of view, international exchanges can be ‘managed’ at the Market<\/em>, Group<\/em> or Watch list<\/em> level (refer to Users’ Knowledge Base >> Setup A Custom Database<\/a> for assistance with organizing Categories<\/em> within AmiBroker<\/em>).<\/p>\n Adapting some of the basic procedures outlined in that tutorial you can either:<\/p>\n 1) Create a new local AmiBroker <\/em>database and use the Metastock Wizard<\/em> to import the symbols into Watch lists<\/em>, folder by folder, and then assign them to Categories<\/em> from there (with the help of categoryAddSymbol<\/em>).<\/p>\n 2) Create a new database and access the symbols using the Metastock<\/em> plug-in (this requires nominating the folders that will be referenced by selecting them in the File >> Database settings >> Configure window<\/em>). From there you will need to import Watch lists,<\/em> that correspond to the Metastock folders, and then assign them to Categories (using categoryAddSymbol once again).<\/p>\n Method 1 will create a static database, for historical back-testing only, and method 2 will create a database that dynamically updates to the Metastock database.<\/p>\n Both database types rely on organizing the symbols into Categories, after the initial setup, if you want to replicate Metastock folders. <\/p>\n <\/p>\n Q3. I have a big database with intraday 1-sec quotes. How can I change the quotes interval in the database to shrink the database size ?<\/em><\/strong><\/p>\n A3. You can use Exploration to generate any desired interval (set Periodicity in AA) and export to ASCII then import back to a new database. Tomasz Janeczko – amibroker.com<\/p>\n AmiBrokerYahooGroup message #116071 "How can I convert AmiBroker tick database to AmiBroker 1-minute dat" http:\/\/finance.groups.yahoo.com\/group\/amibroker\/message\/116071<\/a><\/p>\n <\/strong> <\/p>\n Q2. Is it possible to enter negative values via the Quote Editor?<\/em><\/strong><\/p>\n A2. There is special flag $ALLOWNEG 1 that you can use to allow negative data during ASCII import.<\/p>\n Tomasz Janeczko – amibroker.com<\/p>\n AmiBrokerYahooGroup #116322 "How to enter negative values in quote editor?" http:\/\/finance.groups.yahoo.com\/group\/amibroker\/message\/116322<\/a><\/p>\n <\/p>\n Q1. Is it possible to import tick data with the Wizard in AB?<\/em><\/strong><\/p>\n A1. Tick mode _is_ supported by the wizard. Tomasz Janeczko – amibroker.com<\/p>\n
Do I have to take care of this myself?<\/em><\/strong><\/p>\n
tree leaf. In the Workspace symbol tree a given symbol appears multiple times because it appears in every category leaf that it belongs to, even if this is the same symbol and it exists only as a single entity. One symbol belongs to MANY categories at the same time. For example AAPL (Apple Inc.) will belong to"Stocks" group category, "Nasdaq" market category, "Information" sector category, "Comp-Computer Mfg" industry category, and may also belong to several watch lists and favorites category ALL at the same time.That’s why ONE symbol will appear in many leaves of the symbol tree. Now if you delete the SYMBOL it will of course disappear from ALL categories because you have deleted the SYMBOL.<\/p>\n
2. with free membership: watch lists\/favorites\/indexes – it means that a symbol may belong to ANY number (including zero) of watchlists (and to favorite\/indexcategory too)In this case you can remove this assignment by Watch List -> RemoveWatch lists are covered in detail in the User’s Guide:
http:\/\/www.amibroker.com\/guide\/h_watchlist.html<\/a> (the same is available when you press F1 from AmiBroker)<\/p>\n
C: – MyDatabases – Metastock –
ASX – 0
ASX – 1
ASX – A
ASX – B
ASX – C, etc, etc
LSE – 0
LSE – 1
LSE – A
LSE – B, etc, etc
World Indices<\/p>\n
To use this data within Amibroker<\/em>, I am aware that I can use the Metastock Plug-in<\/em> to recreate my databases in Amibroker,<\/em> as per this link http:\/\/www.amibroker.com\/guide\/h_extsources.html<\/a><\/p>\n
1. each current folder (as listed above),
2. 1 for all the ASX data, 1 for all the LSE data, etc
3. 1 database which captures ALL my data (LSE, ASX & Indices)?<\/p>\n
http:\/\/www.amibroker.com\/kb\/2006\/03\/04\/how-to-export-quotations-from-amibroker-to-csv-file\/<\/a><\/p>\n
You just need to add $TICKMODE 1 in the "Additional Commands" field in the wizard and use "Close" for Last tick price and "Volume" for last tick size.<\/p>\n