Using Our Data With AmiBroker
Overview
Requirements
Installation
FAQ
Overview
Norgate has developed an integration system for AmiBroker that creates a database for each of our data products.
The integration scripts that we provide automatically populate a large number of useful Amibroker symbol lists (Markets, Groups, Sectors and Watchlists) and provide Watchlist updates.
They also maintain each database for symbol and name changes, new listings, delistings etc.
Requirements
Our integration scripts will ONLY work with AmiBroker version 5.30 or higher.
If you have an earlier version of AmiBroker, you can get the latest official release from the AmiBroker downloads area.
The integration scripts work with both the 32 and 64-bit versions of AmiBroker,
however you may need to download the 64-bit MetaStock plug-in for AmiBroker.
Installation
There are separate integration scripts for each of our ASX, SGX, US, Futures and Forex services.
If you have subscribed to more than one service, then you will need to run each relevant script
(this will not interfere with your existing AmiBroker workspaces - new ones will be created).
Installers for the various integration scripts are available from our Downloads area.
Click on a link below to find instructions (and illustrations) on how to integrate our data with AmiBroker.
ASX Stocks
SGX Stocks
US Stocks
Forex
Futures
FAQ
I seem to be missing some recently listed symbols. What do I need to do to be able see them?
Run the mainenance script (Tools > XXX-PremiumData) to pick up any code changes, name changes, new listings and delistings as well as changes to the sectors/industries, index constituents and watchlists.
As the majority of the database maintenance is done over the weekend, we recommend that the maintenance script is run every Monday (as a minimum).
My AmiBroker database is missing a lot of data (or seems to be corrupt). How can I fix this?
Run the mainenance script (Tools > XXX-PremiumData) to refresh the AmiBroker database.
I am missing the Tools > XXX-PremiumData entry. How can I fix this?
Sometimes after upgrading (or reinstalling) AmiBroker, the Tools menu gets reset. You can manually add the maintance script to the Tools menu as follows:
 ASX Stocks
 Hide ASX Stocks
Go Tools > Customize
Click the Tools Tab
Click the New button
Call the item ASX-PremiumData
In the Command item put: wscript.exe
In the Arguments item put: //E:javascript Stocks-PremiumData.js ASX
In the Initial directory put: C:\Trading Applications\\bin
Click Close
Then go Tools > ASX-PremiumData
 SXG Stocks
 Hide SGX Stocks
Go Tools > Customize
Click the Tools Tab
Click the New button
Call the item SGX-PremiumData
In the Command item put: wscript.exe
In the Arguments item put: //E:javascript Stocks-PremiumData.js SGX
In the Initial directory put: C:\Trading Applications\\bin
Click Close
Then go Tools > SGX-PremiumData
 US Stocks
 Hide US Stocks
Go Tools > Customize
Click the Tools Tab
Click the New button
Call the item US-PremiumData
In the Command item put: wscript.exe
In the Arguments item put: //E:javascript Stocks-PremiumData.js US
In the Initial directory put: C:\Trading Applications\\bin
Click Close
Then go Tools > US-PremiumData
 Futures
 Hide Futures
Go Tools > Customize
Click the Tools Tab
Click the New button
Call the item Futures-PremiumData
In the Command item put: wscript.exe
In the Arguments item put: //E:javascript Futures-PremiumData.js
In the Initial directory put: C:\Program Files\AmiBroker\Scripts (or C:\Program Files (x86)\AmiBroker\Scripts)
Click Close
Then go Tools > Futures-PremiumData
 Forex
 Hide Forex
Go Tools > Customize
Click the Tools Tab
Click the New button
Call the item Forex-PremiumData
In the Command item put: wscript.exe
In the Arguments item put: //E:javascript Forex-PremiumData.js
In the Initial directory put: C:\Program Files\AmiBroker\Scripts (or C:\Program Files (x86)\AmiBroker\Scripts)
Click Close
Then go Tools > Forex-PremiumData
How do I reorder the watchlists?
Using Windows Explorer, navigate to "C:\Program Files\AmiBroker\XXX-PremiumData\Watchlists" and edit the "index.txt" file.
You can move your preferred watchlists to the top of the list (be sure to move the items and not copy them as the system cannot handle duplicate entries).
The Dow Jones Industrial Average only shows a few days of data. How can I see more?
If when viewing the Dow Jones Industrial Average chart it only shows a few days of data, it is likely due to a design limitation in Amibroker and a 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 31000. Note: this is enabled by default in the PremiumData Integration Script Installers.
How can I use 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.
 Click here for some examples
 Hide examples
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(0) == 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 = InWatchListName("CBOE Equity Options Underlying") AND IndustryID(0) == 19 AND InWatchListName("S&P 500") AND C > MA(C,30)
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
 Hide
Click Start, All Programs, Accessories, right-click on 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.
For 64-bit Windows type:
cd c:\windows\syswow64\
then
RegSvr32 scrrun.dll
How do I speed up scans/explorations of the Australian Stock Exchange database?
The ASX database contains a lot (20,000+) of exchange traded options (ETOs) and Warrants (3000+).
If you don't trade them and don't need the ETO and/or Warrant data we recommend you remove it with the following steps:
- 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 Tools > ASX-PremiumData. This will then remove the ETOs and/or Warrants from your AmiBroker database too.
How do I access the watchlists in my AFL code?
You can reference the watchlists by name. 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 on 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.
 Click here for instructions
 Hide instructions
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.
Where can I get help on using AmiBroker?
For help with using AmiBroker see the AmiBroker website. Some good books have been written on AmiBroker by Howard Bandy:
Introduction to AmiBroker, Quantitative Trading Systems and
Advanced AmiBroker. There are also some AmiBroker support forums available on the Internet -
AmiBroker Yahoo Group, The Chartist Forum (AmiBroker forum).
Should you require it, paid assistance is also available for AmiBroker.
|