AmiBroker FAQ
AmiBroker is a powerful charting pacakge with scanning and backtesting capabilities. It has the ability to read data from Premium Data and Data
Tools natively using the AmiBroker MetaStock Data Plugin.
This FAQ has the following sections:
Which version of AmiBroker do I need?
Using AmiBroker with Premium Data, DataTools and Forex
Using Markets, Groups, Sectors, Industries and Watchlists in an Exploration
Dow Jones Industrial Average only shows a few days of data
I need more classifications
How are the Premium Data securities laid out within AmiBroker?
I receive the error message "Automation server can't create object" or "Could not start initial objects" when trying to run the Tools->XXX-PremiumData from within AmiBroker. How do I fix this?
How do I speed up scans/explorations of the Australian Stock Exchange database?
How do I access the watchlists in my AFL code?
How do I re-order the watchlists?
How can I increase the scanning speed of AmiBroker?
Why does the volume on the S&P 500, S&P 1500, NASDAQ Composite, NYSE Composite sometimes show as a negative number?
Which version of AmiBroker do I need?
The minimum version required is v5.00 .
If you have a version BEFORE v5.00, please go to the AmiBroker downloads area and download the v5.00 upgrade or installer files.
NOTE: It is imperative you have v5.00 or better on your system. The integration capabiliity will not work with earlier versions.
Using AmiBroker with Premium Data
In 2006, Norgate released a powerful integration mechanism into AmiBroker. To follow these steps, it is assumed that you have Premium Data installed and updating OK. Note that this will NOT intefere with your existing AmiBroker workspaces - a new one will be created.
Integration scripts have been released for ASX, SGX, US, Futures and Forex.
Step 1: Shut down AmiBroker
You must shut down AmiBroker to get started.
Step 2: Download the integration scripts
To use AmiBroker with Premium Data, you need to download and install the AmiBroker Premium Data integration scripts from the downloads area at downloads area.
Step 3: Install the integration scripts
Double click on the file you downloaded (eg AmiBroker-XXX-PremiumData-vx.xx) where XXX is the name of the market (ASX, SGX, US, Futures or Forex) and vx.xx is the version of the file you're downloading. (Note that the AmiBroker Database/Workspace folder is SEPARATE from the Base Data folder you use to install the Stocks, Futures or Forex data)
Step 4: Run the integration script within AmiBroker
Start up Amibroker and open up the XXX-PremiumData database (File -> Open Database then navigate to C:\Program Files\AmiBroker\ then select the XXX-PremiumData folder so the entire path reads C:\Program Files\AmiBroker\ASX-PremiumData). Then click the OK button. Then click Tools -> XXX-PremiumData. After this has been done, all of the symbols, security types sectors, industries and watchlists will be populated automatically within AmiBroker.
Step 5: Set this database as your default database
Within AmiBroker, click Tools then Preferences then select the Data tab. Under the box marked "Default database path" click the Current button then OK.
Step 6: Run the integration script periodically
The XXX-Premium Data script will check to see whether there have been any code changes, delistings or new listings, sector/industry changes, index constituent changes etc. It is recommended you click Tools -> XXX-Premium Data at least once per weeek if not more often to pick up these changes.
Using Markets, Groups, Sectors, Industries and Watchlists in an Exploration
Due to the automated set of markets, groups, sectors, industries and watchlists, it is now very easy to specify in an Exploration a filter to limit your scan to a specific set of securities. Some examples are provided below:
On the ASX data, explore only Fully Paid Orindaries have closed above their 30 day moving average
Filter = InWatchListName("Fully Paid Ordinary") AND C > MA(C,30)
On the ASX data, explore only those securities that can be shorted on CMC Markets and are in the banks industry that have closed below their 30 day moving average
Filter = InWatchListName("CMC ASX Share Shortable CFDs Underlying") AND IndustryID(0) == 20 AND C < MA(C,30)
On the ASX data, explore only the securities in the Health Care Sector that are within the S&P/ASX 300 index that have closed above their 30 day moving average
Filter = InWatchListName("S&P ASX 300") AND SectorID(0)==5 AND C > MA(C,30)
On the US data, explore only only exchange-traded securities (ie no OTC) that have closed above their 30 day moving average
Filter = GroupID(0) == 1 AND C > MA(C,30)
On the US data, explore only NYSE traded securities in the ICB Health Care "Sector" that are within the S&P 1500 index and that have closed above their 30 day moving average
Filter = MarketID(7) == 5 AND SectorID(0)==18 AND InWatchListName("S&P 1500") AND C > MA(C,30)
On the US data, explore only those securities which have CBOE Equity options available to be traded, that are in the Drug Retailers Inudstry, and are in the S&P 500, that have closed above their 30 day moving average
Filter = InWatchList(24) AND IndustryID(0) == 19 AND InWatchListName("S&P 500") AND C > MA(C,30)
How do I re-order the watchlists?
Using Windows Explorer, navigate to Drive C, Program Files, AmiBroker, XXX-PremiumData, Watchlists. Edit the file in there called "index.txt" and put the watchlists you prefer up the top.
Dow Jones Industrial Average only shows a few days of data
If you see open up the Dow Jones Industrial Average chart and it only shows a few days of data, it is likely due to a design limitation in Amibroker and bug
in the Metastock plugin. Amibroker, by design, can only handle dates from 1 Jan 1900 onwards whereas our Dow Jones Industrial Average data goes back to 1896. To
work around this issue, click on File -> Database Settings and change the "Number of bars to Load" to 29000. Note: This is enabled by default in the Premium Data workspace installations.
I need more classifications on the US markets
Unfortunately as AmiBroker only supports two levels of classifications we've decided (after a quick user poll) to provide ICB levels 3 & 4 only.
If you wish to lend your support on this matter, see the following official AmiBroker suggestions:
AmiBroker suggestion 52
Amibroker suggestion 313
If you would like to assist, please leave a comment of support on these suggestions in the above two items.
How are the Premium Data securities laid out within AmiBroker?
Australian Stock Exchange AmiBroker security structure
The ASX security structure is based on the GICS classifications at levels 1 & 2, and a few level 3 classifications where available from the ASX.

Futures AmiBroker security structure
The futures are broken down into exchanges and classifications as below. Note that all futures contracts are also populated with tick size, initial margin, currency and point value to simplify your backtesting.
Forex AmiBroker security structure
The spot forex securities are broken down into exchanges and classifications as below:
|
US Stock Markets AmiBroker security structure
The US security structure is based on the Dow Jones ICB classifications at levels 3 & 4.
|
I receive the error message "Automation server can't create object" or "Could not start initial objects". when trying to run the Tools->XXX-PremiumData from within AmiBroker. How do I fix this?
This is typically due to parts of the Windows system not being properly installed or modified by a badly behaving program. We have only seen this twice with Windows Vista users and we suspect it is due
to a not-so-Vista-compatible piece of software interfering with the registry. Here was how it was fixed:
Click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.
Type the following command and press ENTER.
regsvr32 scrrun.dll
Note that this may result in an error message being reported. This is normal.
Now, reboot your PC, start AmiBroker, then try the Tools -> XXX-PremiumData again.
How do I speed up scans/explorations of the Australian Stock Exchange database?
The ASX database contains a lot (20,000+) exchange traded options (ETOs) and Warrants (3000+). If you don't trade and don't need the ETO and/or Warrant data we recommend you remove it with the following steps:
- Start Premium Data, click the Configuration tab then UNTICK Exchange Traded Options and/or Warrants in the Update ASX Securities of Type box. Click the Save button. Shut down Premium Data.
- Start Windows Explorer (or click your My Computer icon) and navigate to Drive C, Trading Data, Stocks, ASX
- Delete the ETO and/or Warrants Folder.
- Start Premium Data
- Click the Configuration Tab
- Ensure that "Warrants" and "Exchange Traded Options" are unticked for both intraday and end of day.
- Click the Save button
- Exit Premium Data
- Start AmiBroker and click the Tools -> ASX-PremiumData menu item. This will then remove the ETOs and/or Warrants from your AmiBroker database too.
- Now enjoy your significantly pruned database.
How do I access the watchlists in my AFL code?
AmiBroker v4.94 and above has a significant enhanced capacity for watchlists. You can reference your watchlists by name now which is rather powerful. To do this, put a filter into your scans/explorations with:
Filter = InWatchListName("watchlist name here");
for example:
Filter = InWatchListName("S&P 500");
How can I increase the scanning speed of AmiBroker?
Try clicking Tools -> Preferences then click the Data tab. If you increase the In-memory cache size to 20000 (max symbols) that should cover growth in this area for a while. 20000 is the maximum limit within AmiBroker.
The Max MegaBytes can also be increased. Perhaps try increasing this to 1000MB (if you have at least 2GB of RAM) and increase further if you have more RAM. There are just over 37000 symbols in the US database right now back to 1950, taking up around 1900MB of storage space, so if you have the RAM you may be able to bump up the values to accomodate these sizes.
Lastly, AmiBroker can duplicate the data from the MetaStock format database into its own local database which performs the quickest. This has been reported to significantly increase backtesting speeds when performing backtesting across a huge database (such as our listed + delisted stock database back to 1950 which contains over 2GB worth of data and over 37000 securities). This duplication of data comes at the cost of increased disk storage requirements and a more difficult updating process. This is considered to be an advanced step so only do this if you understand the implications.
Step 1: Enable local storage
Click File -> Database Settings and change the "Local data storage" to "Enable".
Step 2: Populate your local database
Click File -> Database Settings and ensure that Data source is set to "MetaStock Plug-in". Then create a simple scan that runs across all securities with a condition that will not fail (Close > 0). After performing step 1, this causes AmiBroker to copy all MetaStock format data into the Local Database.
Step 3: Using your local database
To use the quicker-performing local database, click File -> Database Settings and change the Data source to "(local database)". Then run your scans/system tests/back tests. Note that by using the local database you will not receive any daily updates that are present in the MetaStock format data.
Step 4: Using your MetaStock format database
To view and use the daily updates, you must swap back to the Metastock format database. Click File -> Database Settings and ensure that Data source is set to "MetaStock Plug-in" and Local Data storage is set to "Disable". If you want to perform significant system tests again in the future, repeat steps 2 and 3 to repopulate your local database with up-to-date data.
Why does the volume on the S&P 500, S&P 1500, NASDAQ Composite, NYSE Composite etc. sometimes show as a negative number?
By design, AmiBroker stores volume data internally in a data structure known as a 32 bit signed integer. This data structure can store whole numbers in the range of -2,147,483,648 through 2,147,483,647. If the volume figure exceeds the maximum figure, an "overflow" condition occurs and the volume wraps around to a negative number. For example, the NYSE Composite index had a volume of 3,745,144,031 on Friday 3 May 2008 which significantly exceeds the amount. This is why negative volume is shown on days of very high volume in those few high-volume indexes.
A workaround is available inside AmiBroker, allowing you to divide the volume by a factor. To implement this click File -> Database Settings then click the Configure button. In the "Divide Volume By" field enter a number (eg. 10 or 100 or 1000 - right now 10 seems to be effective across all the US markets for the time being).
A better solution would be for AmiBroker to use a bigger or better data structure (eg. 64 bit unsigned integer) or a floating point field to accomodate such high volumes. If you would like this to be implemented within AmiBroker please login to the AmiBroker Feedback Center. After logging in then click here to show issues #636 and add a comment requesting a permanent solution to the issue.
If you don't yet subscribe to Premium Data and want to take advantage of the automatically updated markets/sectors/groups/industries/watchlists consider taking a free trial to see if it suits your needs.
|