amibroker

HomeKnowledge Base

How to install AmiQuote 3.14 correctly

UPDATE: AmiQuote 3.15 public version is available now.

AmiQuote 3.15 has been announced here: http://www.amibroker.com/devlog/2017/06/01/amiquote-3-15-released/

AmiQuote 3.15 is not a standalone installer, therefore – it requires AmiBroker installed on your computer and the installation path should point to the folder where AmiBroker is installed.

To run the installer – use the link at:
http://www.amibroker.com/bin/aq3150.exe (113KB) – 32 bit version
http://www.amibroker.com/bin/aq3150x64.exe (135KB) – 64 bit version

Make sure to download correct version. If you have 32-bit AmiBroker, use 32-bit AmiQuote. If you have 64-bit AmiBroker, use 64-bit AmiQuote. If you have both, install both.

32-bit version of AmiBroker

If you are running 32-bit version of AmiBroker, please make sure to point AmiQuote installation into the correct folder. The default installation path is the following:

Image1

64-bit version of AmiBroker

The default installation path of 64-bit AmiBroker version is the following:

Image1

TROUBLESHOOTING:

  1. If you are getting “Failed to update registry, use REGEDIT” message, then you need to run AmiQuote at least once with administrator rights – to do so click on AmiQuote icon with right mouse button and select “Run As Administrator”
  2. If you are getting close and volume data exchanged then it means you did not install properly the program and updated aqh.format file is missing. You must make sure that aqh.format file inside Formats directory is NEW (from May 17, 2017). It is included in the setup program so just follow instructions above.
  3. If you are not able to download more than 2 years worth of data it means you entered too early “From” date. For example if you enter 1900 as “from” date you won’t get more than recent 2 years. But if you enter more resonable starting date such as year 2000, then you will be able to download 17 years worth of data
  4. The download hangs on Windows XP – new Yahoo Finance pages are incompatible with Windows XP, and specifically with Internet Explorer 9 or lower that Windows XP shipped with. Windows XP is obsolete and not supported anymore by Yahoo. You need at least Internet Explorer 10 to be installed (Windows 7)
  5. If it still does not work – you did something wrong. The program works fine, as long above steps are PRECISELY done. Rinse and repeat until it clicks.

Purchases from Hong Kong

Customers from Hong Kong sometimes have problems ordering because there are no ZIP codes in Hong Kong and SWREG system that we are using requires ZIP code. If you are buying using credit card, entering 0000 or NA in place of ZIP code field is accepted. But if you are buying using PayPal, it may reject it if your PayPal account does not have matching ZIP code. Therefore, if you are using PayPal you need to follow these instructions:

  1. Update your PayPal account billing address with ‘0000’ in the Postal Code/ZIP field
  2. Now you can use 0000 as ZIP code in SWREG ordering page

Differences between 32-bit and 64-bit version

One common issue that surfaces pretty often is the lack of full understanding of differences between 32-bit and 64-bit versions of AmiBroker among users. This article tries to explain some of the most important bits.

WHICH VERSION DO I HAVE?

To find out which version you have installed just go to Help->About window. It clearly says “32-bit” or “64-bit” in the About window.

OPERATING SYSTEM COMPATIBILITY

32-bit version of AmiBroker is compatible with BOTH 32-bit and 64-bit Windows.
64-bit version of AmiBroker is compatible with 64-bit Windows ONLY.

32-bit version running on 64-bit OS can fully utilize as much as 4GB of RAM for the program data.
The rest of RAM is used for OS, file system cache, system libraries, etc.
64-bit can theoretically use all RAM available but Windows itself has some limits (see Microsoft web pages for details)

More on OS system compatibility can be found here: http://www.amibroker.com/guide/compat.html

REGISTRATION / ACTIVATION KEY

There are separate activation keys for 32-bit and 64-bit version. The key for 32-bit version is ABReg.exe, while the key for 64-bit version is named ABReg64.exe. If you apply wrong key (32-bit key for 64-bit application or vice versa), you will not get any error message but the application will still show “Unregistered”. So make sure you apply 32-bit key (ABReg.exe) to 32-bit application and 64-bit key (ABReg64.exe) to 64-bit application.

Also note that 64-bit key is available only to those who registered “Professional Edition”.

DATA SUPPORT

32-bit version offers the widest selection of supported data sources (all listed here: http://www.amibroker.com/guide/h_quotes.html )

Many 3rd party data sources that are not listed above come in 32-bit only.

64-bit offers limited support for data sources due to the fact that 64-bit support requires 64-bit API from data vendor, and this is not always available.

For more information:
http://www.amibroker.com/guide/compat.html

Typically if you put 3rd party data vendor DLL into “Plugins” directory and it does not show up in the data source list it means that its bitness is wrong (see below for more info).

PLUGIN COMPATIBILITY

Because of Windows OS limitations, 32-bit application is not able to load 64-bit DLLs and 64-bit application is not able to load 32-bit DLLs. In other words the “bitness” of application and DLLs must match. This has wide consequences with respect to plugins. Since plugins are just DLLs (dynamic load libraries), if you want to use a plugin you need to make sure it matches the bitness of your application. As majority of 3rd party plugins come only in 32-bit, so 32-bit version of AmiBroker offers widest selection of data plugin support.

FILE FORMAT COMPATIBILITY

We have put a lot of effort into making files compatible between 32-bit and 64-bit versions, so at the moment all formulas (AFL), project files (APX), all binary databases, layouts, watch lists are all 100% binary compatible between 32-bit and 64-bit versions, as long as they are smaller than 4GB. The only exception are DLLs (plugins) which are different for 32-bit and 64-bit as mentioned above.

PERFORMANCE

Generally speaking 64-bit offers pretty much same performance as 32-bit version. The difference in speed is marginal. The only true advantage of 64-bit versions is ability to address more than 4GB of RAM and support larger data sets.

PRECISION

Contrary to ‘common sense’, 64-bit applications are not more precise. Due to Intel/AMD/Microsoft decision the support for extended double 80-bit floating point (x87 FPU) has been dropped in 64-bit compilers and replaced by less accurate 64-bit floating point SSE2 for sake of speed. That is why you may see some speed up in 64-bit application. 32-bit code computes all results with internal 80 bit accuracy due to the use of 80 bit FPU unit. 64-bit does so with at most 64-bits. Also the ‘old’ x87 FPU handles way more instructions in hardware (like transcendentals), while new SSE2 only has basic math and all more complex functions are implemented in runtime library. While we are building both versions from the very same C/C++ source code and are striving to provide same results from all functions, these architectural differences can cause that output of 32-bit version is more precise.

More on floating point arithmetic can be found here: http://www.amibroker.com/kb/2010/07/20/about-floating-point-arithmetic/

How to fix Error 61 in printf/StrFormat calls

AmiBroker version 6.07 has introduced a strict check for correct string formatting in printf and StrFormat functions. These functions allow to specify the string followed by the list of arguments that will be inserted into the string in places, where %f, %g or %e specifiers are entered.

This works the following way:

StrFormat example

It is important for the list of subsequent arguments to match the number of % specifiers in the string. In cases, where there is no match – AmiBroker will display Error 61 message. Strict check is required because Microsoft C runtime crashes if wrong parameters are passed. Passing on earlier version was dangerous because it would lead to random crashes now and then depending on machine configuration.

There may be the following typical problems in the code:

Example 1. Four % specifiers, five value arguments

In this example formatting string contains four % specifiers so AmiBroker expects four arguments coming later, but five are given instead (too many).

// WRONG - too many value arguments
Title StrFormat"Open: %g, High: %g, Low: %g, Close: %g"OpenHighLowCloseVolume );

// CORRECT
Title StrFormat"Open: %g, High: %g, Low: %g, Close: %g"OpenHighLowClose );

Example 2. Five % specifiers, four value arguments

In this example formatting string contains five % specifiers so AmiBroker expects five arguments coming later, but four are given instead (too few).

// WRONG - %.0f specifier does not have a matching argument
Title StrFormat"Open: %g, High: %g, Low: %g, Close: %g, Volume: %.0f"OpenHighLowClose );

// CORRECT
Title StrFormat"Open: %g, High: %g, Low: %g, Close: %g, Volume: %.0f"OpenHighLowCloseVolume );

Example 3. Incorrectly coded percent (%) sign

In this example user wanted to print just % (percent sign), but used % (wrong) instead of %% (correct specifier of literal percent sign).

// WRONG - to show the % sign in the output we need to use %%
Title StrFormat"Close: %g (%.1f%)"CloseSelectedValueROCClose1) ) );

// CORRECT - you should use %% to print actual percent sign
Title StrFormat"Close: %g (%.1f%%)"CloseSelectedValueROCClose1) ) );

The example 3 requires special attention, as it is a common mistake. Due to the fact that % sign is a special character, we need to use %% in our string if we want to print % sign in the output string.

“Invalid symbol” message for stocks traded on multiple exchanges (IB)

Some of the symbols available from Interactive Brokers data-feed may be traded on multiple exchanges. In such case, when we enter the symbol to the database as:

INTCGLDCSCO

then we may see “Invalid symbol” message displayed by the Interactive Brokers plugin, as symbol SMART-STK-USD default format is not enough to uniquely identify the symbol. Therefore we would need to specify the primary exchange for the given symbol.

The primary exchange can be specified in the symbol using -!EXCHANGE suffix, so we can write the symbol like this

INTC-!NASDAQ

and it will instruct Interactive Brokers plugin to send NASDAQ as Primary Exchange for INTC to TWS.

We can however maintain similar ticker naming for all symbols in our database and use short names for all US symbols. To make it possible there is special dictionary (or translation table) for IB symbols that both plugin and IB automated trading interface use. In AmiBroker main folder there is a IBDictionary.txt file, which we can edit with any plain text editor (like Notepad) and provide symbol translations. It describes how symbols are translated before plugin communicates with TWS API.

The format of this file is CSV (comma separated values):

InputSymbol,OutputSymbol, comment (optional)

For example:

INTC,INTC-!NASDAQ, This is because INTC is now traded on multiple exchanges, so we need to set primary exchangeCSCO,CSCO-!NASDAQ, The same as above MSFT,MSFT-!NASDAQGLD,GLD-!ARCA

Deleting symbols with comma in the name

When importing symbols into the database, we may sometimes encounter situations, when as a result of user-mistake we import erroneous ticker names into our database. This may for example happen when we specify an incorrect column separator in ASCII importer (or use incorrect import definition that does not match the imported file) or when we use input file that contains commas when importing watchlist members using Symbol->Watchlist->Import.

As a result – we may end up with a ticker list like this:

Problematic symbols

In this case marking the symbols in Symbols window and using Delete option from the context menu will not work, because AmiBroker treats the comma as a separator between symbols.

To solve the problem – with relatively few tickers we can always just open Symbol->Information window and fix the names in there. However – with a larger group of symbols it will not be very practical.

In such case, in order to delete the incorrect symbols from the database – we can use Symbol->Organize Assignments window, mark the tickers in left-hand-side panel and press Delete to remove these symbols.

Removing problematic symbols

There is also a way to delete the symbols manually from the database folder by removing respective data-files. This requires the following steps:

  1. Exit AmiBroker
  2. go to respective subfolder of the database folder (in Windows Explorer)
  3. delete data-files for the particular symbols
  4. delete broker.master file from the database folder (it stores the symbol list)
  5. restart AmiBroker and load the database

Running OLE automation scripts with 32- and 64-bit versions of AmiBroker

Automation scripts written in JScript or VBScript are supposed to be run from Windows Explorer to control AmiBroker from outside and run certain predefined tasks specified in the script. The recommended documentation explaining the automation interface and AmiBroker object model is presented here:
http://www.amibroker.com/guide/objects.html
http://www.amibroker.com/newsletter/01-2000.html

In case of any problems with execution of automation scripts, the very first thing to check is the .js (JScript) or .vbs (VBScript) file association within the Windows Control Panel. This determines which program in Windows executes the files with .js extension. By default that should be Windows Scripting Host, which is the default scripting engine integrated into Windows.

The following Microsoft help resources show how to change the file associations:
http://windows.microsoft.com/en-us/windows/change-default-programs#1TC=windows-7
http://windows.microsoft.com/en-us/windows-8/choose-programs-windows-uses-default

The other thing to remember is the fact that in 64-bit Windows there are actually two JavaScript engines, 32- and 64-bit. The location of those programs are:

32-bitC:\Windows\SysWOW64\CScript.exe64-bitC:\Windows\System32\CScript.exe

If only one AmiBroker version installed, Windows would launch this installed version regardless of which scripting engine was used.

Things look differently if you installed both 32-bit and 64-bit versions of AmiBroker on the very same machine. In this case 32-bit scripting engine would open 32-bit AmiBroker while 64-bit scripting engine would open 64-bit AmiBroker.Therefore, if we want to specifically launch 32-bit AmiBroker, then pointing at the particular engine by using command line may be required:

C:\Windows\SysWOW64\CScript.exe Filename.js

(this one is for 32-bit version, the path names are in fact quite confusing, since Microsoft uses System32 folder for 64-bit programs in a 64-bit system).

FastTrack data configuration and troubleshooting

General configuration process for FastTrack datasource is explained in the manual:
http://www.amibroker.com/guide/h_extsources.html

Sometimes however, after the configuration process the FastTrack data source is still missing from the list of sources in File->Database Settings. If that happens, please follow the steps listed below to make this source available:

First you need to make sure that you are using 32-bit version of AmiBroker as FastTrack is 32-bit application and only the other 32-bit application can use its data via their API. To check what version of AmiBroker you have go to Help->About window. If you do not have proper version, please download 32-bit one from http://www.amibroker.com/download.html

Secondly you need to install FastTrack for the Web (FT4Web) program. If you are using Windows Vista, Windows 7 or Windows 8, it is good idea to first turn OFF User Access Control (down to “Never notify”). The following video shows the process:
http://windows.microsoft.com/en-US/windows7/Turn-User-Account-Control-on-or-off. Then install FastTrack for the web (FT4Web) program.

If the FastTrack datasource is still missing from the data source combo in Database Settings, then it is necessary to check if:

  1. FT.DLL is inside “AmiBroker/Plugins” folder
  2. FastTrack.DLL file is installed by FT4Web inside Windows folder

If it can not be found in the Windows folder, we need to make sure that FastTrack for the web is installed, then perform a search for FastTrack.DLL file using Windows Explorer file search.

Once the FastTrack.DLL file is found, we need to copy it to AmiBroker main folder – then FastTrack datasource should then become available in AmiBroker.

How to get support most efficiently

As a customer you want to have your questions and issues resolved most quickly and it is also our goal. In order to allow us to serve you the best possible answer in shortest possible time you need to provide some essential information that we can not collect without your help.

The most essential things you need to tell us when contacting support are:

  1. AmiBroker version you are running
  2. Data source you are using
  3. Exact error message you are getting, or screenshot if problem is of “visual” type
  4. The AFL formula that you are using (if question/issue is formula-related)
    and the settings (if you want help on backtest/optimization results)

  5. … and pretty please do not yell that you found a bug (there are 99.9% chances you did not).

If we counted the hours spent on e-mail exchange that was just asking for those details it would sum up to years. Please provide those in front. We really don’t know what you are running on your end.

There are countless examples when knowledge of these details would save hours of time (not only our but your time too). For example we write a formula for somebody, then he responds “it does not work” then we ask for details on what exactly does not not work and after some hours and e-mail exchanges it turns out that the customer is using old version of the software, while our formula used a function that was introduced lately.

Version numbers

When specifying AmiBroker version number please tell the number, not just “I am using latest version”, because latest means different thing for you and different for us. Your “latest” may mean latest official release and we may mean latest BETA that we just released a couple of minutes ago, so you are not even aware of it. So to remove doubt, please tell us exact number such as “I am running v5.85.0 32-bit”. You can find exact version number in the Help->About window.

Sometimes it also helps to know Windows version. For example we have seen cases when execution speed was different on XP and Windows 7 or when some feature did not work correctly on Windows XP because of Windows bug. So if you are reporting a problem/bug please include Windows version too. In this case you don’t need to tell us exact version, so “I am running Windows XP” or “Windows 7 64-bit” is perfectly fine.

The data source

Telling us a Data source is important when you are using plugin-driven data source. Pretty often 3rd party data sources that are plugin driven can cause bizzarre issues that can not be reproduced unless we know the data source.

Tell us what the error is or how it looks

It goes without saying that knowing the actual text of error message you get is essential for us. Please quote the message precisely as sometimes actual wording differs and there may be two similar messages yet they are different and resolution is also different. For any kind of “visual” problems it is best to send a screenshot. To make a screenshot, press PRINT SCREEN key on the keyboard (to make a short of entire screen), or ALT+PRTSCREEN (to make a screenshot of just active window). This puts a screenshot to the clipboard. Now you can paste it to MS Paint, MS Word, or any other graphic application. Some e-mail clients such as Thunderbird, allows pasting such image directly from clipboard into message (Edit->Paste, or Ctrl+V).

Sometimes it may not be obvious what is wrong on the screenshot so please describe what is wrong and/or annotate graphics. It helps tremendously.

The magical formula

As far as AFL-related problems are considered, knowing the formula is essential. If we can paste your formula to editor and reproduce reported behaviour on our end helping you becomes much easier and faster. An enormous amount of time could be gained if formula in question is sent to us. If for some reason you can not send us actual formula that you are using, please try to write a small one that just demonstrates the same problematic behavior. It is even better to have such minimalistic formula as it is quicker to find problem area in shorter one. When you are reporing problem with the backtest or optimization please also include the settings. Instead of sending formula and settings separately, consider sending APX file (Analysis Project). The analysis project file has both settings and formula included and can be saved using File->Save As when Analysis window is open.

When something is bugging you

Now here it comes, the last but certainly not least hint. When you are having problems with our software, please do not claim you have found a bug unless you are very, very sure of your ground. Remember, there are many other users that are not experiencing your problem. Otherwise you would have learned about it while reading the documentation and searching the Web (you did do that before complaining, didn’t you?). This means that very probably it is you who are doing something wrong, not the software. In fact in 99.9% of past cases a suspected “bug” was a user mistake.

We put an enormous effort and engineering skills to make our software working as well as possible. If you claim you have found a bug, you will be impugning our competence, which will offend some of us even if you are correct. It is especially undiplomatic to yell bug in the Subject line.

When asking your question, it is best to write as though you assume you are doing something wrong, even if you are privately pretty sure you have found an actual bug. If there really is a bug, you will hear about it in the answer.

All of the above has one goal – enabling us to help you better and quicker. By following the guidelines above you will get your answers delivered faster and more efficiently. Thanks!

Third party software “black list”

From time to time users face bizarre problems that after hours/days of investigation turn to be caused by 3rd party softwares that modify normal operation of Windows OS and cause troubles. As most problems are caused by badly written antiviruses, we recommend using Microsoft Security Essentials that is known to be OS friendly, working fast and without issues.

Here is a list of 3rd party software that are known to cause problems:

1. Avast Antivirus – specifically it’s Autosandbox feature messes up with operating system and effectively disallows application to write data to the disk. Which means that any of your changes to the data, watch lists, drawings, etc, will not be saved unless you turn off Autosandbox or uninstall Avast. Avast has its “heuristics” all wrong. They use Autosandbox even on legitimate, Microsoft Authenticode digitally signed applications like AmiBroker. Solution: uninstall Avast and install Microsoft Security Essentials instead.

2. Comodo Internet security – the same story as above – their “Sandbox” is messing up with OS and blocks applications from vital activity such as saving files or accessing registry. Their “sandbox” causes files to be stored in wrong places and become inaccessible. Either turn off sandbox or uninstall Comodo and install Microsoft Security Essentials instead.

3. Webroot Secure Anywhere – again it messes up with operating system causing problems with Windows Clipboard, preventing Edit->Paste from working in many applications including the new AFL editor. The solution is to go to Webroot Identity Protection settings and turn OFF Identity Shield. The issue affects many applications and is described in detail on their forum:
https://community.webroot.com/t5/Webroot-SecureAnywhere-Complete/Copy-Paste-Stops-Working-in-some-applications/td-p/21588/page/4

4. AMD Catalyst Software Suite, Desktop Desktop Manager – it may cause problems with saving window positions because it has a feature called “Dialog repositioning” that moves windows by itself somewhere else. AMD of course knows better where you want to have your windows. Solution: disable “Dialog repositioning” as shown below or turn off “Desktop Manager” feature. You may also uncheck “Preserve application position and size” box because AmiBroker remembers positions of all its windows by itself and does not need AMD’s help.

catalyst

For the list of recommended hardware and software see: http://www.amibroker.com/kb/2011/10/25/recommended-hardwaresoftware-for-amibroker/

Next Page »